<!-- Generated by `just docs` from catalog/toolkits/segment.yaml, catalog/expansions/segment.yaml, catalog/evals/scorecard.json. Edit the source, not this file. -->

# Segment

Customer data pipelines. Manage sources and destinations, and write the tracking plan rules that say what a valid event looks like.

| Property | Value |
| --- | --- |
| Slug | `segment` |
| Definition version | `0.1.0` |
| Base URL | `https://api.segmentapis.com` |
| Auth schemes | `api_key` |
| Action tools | 35 |
| By class | 16 read, 11 write, 8 destructive |
| Triggers | 0 |
| Provider rate limit | not declared, so outbound calls are unpaced |

## Measured routing accuracy

47 golden cases replayed through the router over the whole index: measured over corpus `ea4f12ad2948` (65 toolkits, 2283 tools indexed and 13 declared uncallable), 35 cases written by hand and 12 cases from the paraphrase pass. A case counts as top-1 when its gold tool ranked first and top-8 when it reached the slate at all.

| Measure | Cases | Share |
| --- | --- | --- |
| top-1 | 36/47 | 76.6% |
| top-8 | 47/47 | 100.0% |

The sweep is offline: the reranker is a deterministic identity fake that returns candidates in the order retrieval produced them, so top-1 measures retrieval order rather than a reranked slate. `just eval-live` measures the same cases through the live reranker.

## Authentication

Connect an entity with `ConnectionsService.InitiateConnection`, naming this toolkit's slug. Credentials stay in the connections vault; callers hold connected-account ids only.

### `api_key`

| Property | Value |
| --- | --- |
| Placement | `header` |
| Name | `Authorization` |
| Rendered as | `Bearer {key}` |

Submit the key with `ConnectionsService` rather than putting it in a request; it is sealed at rest and never returned.

## Tools

35 action tools. The catalog-wide slug is `segment.<tool>`, which is what `search_tools` returns and `call_tool` takes.

### `segment.create_source`

Create a new Segment source, the collection point data flows in from. Use when the user wants to add, connect, or set up a new source, app, or website in Segment. Needs a catalog metadata id for the source type (see list_source_catalog) and a workspace-unique slug.

Class `write` (writes, no confirmation needed). Scopes `sources:write`. Calls `POST /sources`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `enabled` | boolean | no | Whether the source accepts data immediately. Defaults to true. |
| `metadata_id` | string | **yes** | Segment catalog id for the source type, from list_source_catalog. |
| `slug` | string | **yes** | Workspace-unique identifier for the new source, e.g. "prod-web-app". |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.source` | object |  |
| `data.source.enabled` | boolean |  |
| `data.source.id` | string |  |
| `data.source.name` | string |  |
| `data.source.slug` | string |  |
| `data.source.writeKeys` | array of string |  |

Also retrieved by: "hook up a new app to feed us data", "I need a fresh collection point for this website", "onboard our new mobile app into the pipeline", "start pulling events from a new place", "register a new place data can come in from".

### `segment.get_source`

Get one Segment source by id: its slug, name, enabled state, and write keys. Use when the user names a specific source. For finding or browsing all sources, use list_sources.

Class `read` (reads only). No scopes beyond the connection's defaults. Calls `GET /sources/{{params.source_id}}`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `source_id` | string | **yes** | Segment source id, e.g. "src_2VbA1u9ZpQx7Nk". |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.source` | object |  |
| `data.source.enabled` | boolean |  |
| `data.source.id` | string |  |
| `data.source.name` | string |  |
| `data.source.slug` | string |  |
| `data.source.trackingPlanId` | string |  |
| `data.source.writeKeys` | array of string |  |

Also retrieved by: "pull up the details on this integration point", "what write keys does this app have", "check the setup for this specific input".

### `segment.list_sources`

List sources in the workspace. Use when the user asks what sources, apps, or sites are set up in Segment, or wants to browse them all. For one known source, use get_source.

Class `read` (reads only). No scopes beyond the connection's defaults. Calls `GET /sources`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `cursor` | string | no | Pagination cursor from a previous page's response. |
| `limit` | integer | no | Results per page. Defaults to 50. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.pagination` | object |  |
| `data.pagination.current` | string |  |
| `data.pagination.totalEntries` | integer |  |
| `data.sources` | array of object |  |
| `data.sources[].enabled` | boolean |  |
| `data.sources[].id` | string |  |
| `data.sources[].name` | string |  |
| `data.sources[].slug` | string |  |

Also retrieved by: "what's feeding data into our workspace", "show every app and site we're collecting from", "browse all our collection points".

### `segment.update_source`

Pause or resume a source, or rename it. Use when the user wants to turn a source's data collection on or off, or update its display name. Does not change the source's write keys or its type.

Class `write` (writes, no confirmation needed). Scopes `sources:write`. Calls `PATCH /sources/{{params.source_id}}`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `enabled` | boolean | no | True to resume data collection, false to pause it. |
| `name` | string | no | New display name for the source. |
| `source_id` | string | **yes** | Segment source id to update. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.source` | object |  |
| `data.source.enabled` | boolean |  |
| `data.source.id` | string |  |
| `data.source.name` | string |  |

Also retrieved by: "pause this app so it stops sending data", "turn collection back on for this integration", "rename this input to something clearer".

### `segment.delete_source`

Permanently delete a source and stop it from collecting data. Irreversible; any app still using its write keys starts failing to send events. Use only when the user explicitly asks to delete or remove a source entirely, not just pause it.

Class `destructive` (held by the mutation gate until the call's own arguments carry `"confirm": true`). Scopes `sources:write`. Calls `DELETE /sources/{{params.source_id}}`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `source_id` | string | **yes** | Segment source id to delete. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `deleted` | boolean |  |

Also retrieved by: "rip this integration out for good", "get rid of this collection point entirely", "we're done with this app, remove it completely".

### `segment.create_source_write_key`

Issue a new write key for a source, so a second app instance or environment can send events under the same source. Use when the user wants to add, generate, or rotate in a new write key.

Class `write` (writes, no confirmation needed). Scopes `sources:write`. Calls `POST /sources/{{params.source_id}}/writekey`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `source_id` | string | **yes** | Segment source id to issue a write key for. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.writeKey` | string |  |

Also retrieved by: "I need a second key for the staging build", "generate a fresh key so another instance can send data", "issue a new credential for this app to use".

### `segment.delete_source_write_key`

Revoke one write key from a source. Irreversible; whatever was sending events with that key immediately stops being accepted. Use when the user wants to revoke, disable, or retire a specific write key, e.g. after a leak.

Class `destructive` (held by the mutation gate until the call's own arguments carry `"confirm": true`). Scopes `sources:write`. Calls `DELETE /sources/{{params.source_id}}/writekey/{{params.write_key}}`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `source_id` | string | **yes** | Segment source id the write key belongs to. |
| `write_key` | string | **yes** | The write key to revoke. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `deleted` | boolean |  |

Also retrieved by: "that key leaked, kill it", "revoke the old credential, we rotated it", "shut off access for this specific key".

### `segment.list_source_catalog`

Browse the catalog of source types Segment supports (web, mobile, server, cloud-app), each with the metadata id create_source needs. Use when the user asks what kind of source to add, or is looking for a specific source type by name.

Class `read` (reads only). No scopes beyond the connection's defaults. Calls `GET /catalog/sources`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `limit` | integer | no | Results per page. Defaults to 50. |
| `search` | string | no | Filter catalog entries by name, e.g. "ios" or "shopify". |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.sources` | array of object |  |
| `data.sources[].categories` | array of string |  |
| `data.sources[].id` | string |  |
| `data.sources[].name` | string |  |
| `data.sources[].slug` | string |  |

Also retrieved by: "what kinds of apps can we hook up", "is there a ready-made option for an iOS app", "browse the available integration types", "what platforms does this support as an input".

### `segment.create_destination`

Connect a new destination to a source, so its data starts flowing to a tool like an analytics suite or ad platform. Use when the user wants to add, connect, or turn on a destination. Needs a catalog metadata id for the destination type (see list_destination_catalog).

Class `write` (writes, no confirmation needed). Scopes `destinations:write`. Calls `POST /destinations`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `config` | object | no | Destination-specific settings, e.g. {"apiKey": "..."} for the chosen destination type. |
| `enabled` | boolean | no | Whether data starts flowing immediately. Defaults to true. |
| `metadata_id` | string | **yes** | Segment catalog id for the destination type, from list_destination_catalog. |
| `source_id` | string | **yes** | Segment source id the destination receives data from. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.destination` | object |  |
| `data.destination.enabled` | boolean |  |
| `data.destination.id` | string |  |
| `data.destination.name` | string |  |

Also retrieved by: "route this app's data over to our analytics tool", "hook this source up to an ad platform", "start sending events to a new downstream tool", "connect our warehouse-adjacent tool as an output".

### `segment.get_destination`

Get one destination by id: its name, enabled state, and config. Use when the user names a specific destination. For finding or browsing all destinations on a source, use list_destinations.

Class `read` (reads only). No scopes beyond the connection's defaults. Calls `GET /destinations/{{params.destination_id}}`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `destination_id` | string | **yes** | Segment destination id, e.g. "dst_2VbA1u9ZpQx7Nk". |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.destination` | object |  |
| `data.destination.config` | object |  |
| `data.destination.enabled` | boolean |  |
| `data.destination.id` | string |  |
| `data.destination.name` | string |  |
| `data.destination.sourceId` | string |  |

Also retrieved by: "check the config on this downstream connection", "is this output still turned on", "pull up what this specific output is set to".

### `segment.list_destinations`

List destinations, optionally filtered by source. Use when the user asks where a source's data flows to, or wants to see every destination connected in the workspace.

Class `read` (reads only). No scopes beyond the connection's defaults. Calls `GET /destinations`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `limit` | integer | no | Results per page. Defaults to 50. |
| `source_id` | string | no | Only destinations connected to this source id. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.destinations` | array of object |  |
| `data.destinations[].enabled` | boolean |  |
| `data.destinations[].id` | string |  |
| `data.destinations[].name` | string |  |
| `data.destinations[].sourceId` | string |  |

Also retrieved by: "where does this app's data end up going", "show every tool we're forwarding events to", "what's this source connected to downstream".

### `segment.update_destination`

Turn a destination on or off, or change its config. Use when the user wants to enable, disable, or reconfigure where a source's data is delivered.

Class `write` (writes, no confirmation needed). Scopes `destinations:write`. Calls `PATCH /destinations/{{params.destination_id}}`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `config` | object | no | Replacement destination-specific settings. |
| `destination_id` | string | **yes** | Segment destination id to update. |
| `enabled` | boolean | no | True to resume delivery, false to pause it. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.destination` | object |  |
| `data.destination.enabled` | boolean |  |
| `data.destination.id` | string |  |

Also retrieved by: "flip this output off for now", "swap the api key on this downstream connection", "turn delivery back on for this tool".

### `segment.delete_destination`

Permanently remove a destination. Irreversible; data stops flowing there and its config is not recoverable. Use only when the user explicitly asks to delete or disconnect a destination entirely, not just pause it.

Class `destructive` (held by the mutation gate until the call's own arguments carry `"confirm": true`). Scopes `destinations:write`. Calls `DELETE /destinations/{{params.destination_id}}`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `destination_id` | string | **yes** | Segment destination id to delete. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `deleted` | boolean |  |

Also retrieved by: "cut the feed to this analytics tool entirely", "unhook this downstream connection for good", "stop sending anything there, remove it completely".

### `segment.get_destination_delivery_metrics`

Get a destination's delivery health: how many events succeeded or were dropped recently. Use when the user asks whether a destination is actually receiving data, or wants to check for delivery errors.

Class `read` (reads only). No scopes beyond the connection's defaults. Calls `GET /destinations/{{params.destination_id}}/delivery-metrics`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `destination_id` | string | **yes** | Segment destination id to check. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.errorCount` | integer |  |
| `data.lastEventAt` | string |  |
| `data.successCount` | integer |  |

Also retrieved by: "is this tool actually getting our data", "check for delivery failures on this output", "how many events bounced going to this destination".

### `segment.list_destination_catalog`

Browse the catalog of destination types Segment supports (analytics tools, ad platforms, warehouses, and more), each with the metadata id create_destination needs. Use when the user asks whether Segment has a ready integration for a specific tool to send data to, or is picking one to connect.

Class `read` (reads only). No scopes beyond the connection's defaults. Calls `GET /catalog/destinations`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `limit` | integer | no | Results per page. Defaults to 50. |
| `search` | string | no | Filter catalog entries by name, e.g. "amplitude" or "google ads". |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.destinations` | array of object |  |
| `data.destinations[].categories` | array of string |  |
| `data.destinations[].id` | string |  |
| `data.destinations[].name` | string |  |
| `data.destinations[].slug` | string |  |

Also retrieved by: "do you support amplitude as an output", "what tools can we forward data to", "browse the list of things we could connect downstream".

### `segment.create_destination_subscription`

Add a subscription rule to a destination, filtering which events it receives. Use when the user wants to send only certain events, e.g. just track calls or one event name, to a particular destination.

Class `write` (writes, no confirmation needed). Scopes `destinations:write`. Calls `POST /destinations/{{params.destination_id}}/subscriptions`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `destination_id` | string | **yes** | Segment destination id to add a subscription to. |
| `enabled` | boolean | no | Whether the rule is active. Defaults to true. |
| `name` | string | **yes** | Label for this subscription rule. |
| `subscribe` | string | **yes** | Filter expression selecting which events match, e.g. "type = \"track\" and event = \"Order Completed\"". |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.subscription` | object |  |
| `data.subscription.enabled` | boolean |  |
| `data.subscription.id` | string |  |
| `data.subscription.name` | string |  |
| `data.subscription.subscribe` | string |  |

Also retrieved by: "only forward checkout events to this tool", "filter what this output actually receives", "set up a rule so only one event type goes through".

### `segment.list_destination_subscriptions`

List the event filter subscriptions configured on a destination. Use when the user asks which events go to a destination, or wants to review its filtering rules before changing them.

Class `read` (reads only). No scopes beyond the connection's defaults. Calls `GET /destinations/{{params.destination_id}}/subscriptions`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `destination_id` | string | **yes** | Segment destination id to list subscriptions for. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.subscriptions` | array of object |  |
| `data.subscriptions[].enabled` | boolean |  |
| `data.subscriptions[].id` | string |  |
| `data.subscriptions[].name` | string |  |
| `data.subscriptions[].subscribe` | string |  |

Also retrieved by: "what filters are on this connection right now", "show the rules deciding what gets through to this tool", "what's currently being forwarded here and what's blocked".

### `segment.delete_destination_subscription`

Remove an event filter subscription from a destination. Irreversible; without it the destination falls back to whatever broader default it had, which may mean it starts receiving events it was previously filtered from. Use when the user wants to remove or cancel a specific filtering rule.

Class `destructive` (held by the mutation gate until the call's own arguments carry `"confirm": true`). Scopes `destinations:write`. Calls `DELETE /destinations/{{params.destination_id}}/subscriptions/{{params.subscription_id}}`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `destination_id` | string | **yes** | Segment destination id the subscription belongs to. |
| `subscription_id` | string | **yes** | Subscription id to remove. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `deleted` | boolean |  |

Also retrieved by: "drop that filtering rule, send everything again", "remove this specific forwarding condition", "take off the restriction on what reaches this tool".

### `segment.create_tracking_plan`

Create a new tracking plan, the named collection of event rules a workspace validates data against. Use when the user wants to start, set up, or draft a new tracking plan or data governance spec.

Class `write` (writes, no confirmation needed). Scopes `tracking-plans:write`. Calls `POST /tracking-plans`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `description` | string | no | What this tracking plan governs, e.g. "checkout funnel events". |
| `name` | string | **yes** | Display name for the tracking plan. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.trackingPlan` | object |  |
| `data.trackingPlan.id` | string |  |
| `data.trackingPlan.name` | string |  |
| `data.trackingPlan.slug` | string |  |

Also retrieved by: "start a new spec for what our events should look like", "draft up a governance doc for our checkout events", "set up a fresh schema plan for the team".

### `segment.get_tracking_plan`

Get one tracking plan by id: its name, description, and last updated time. Use when the user names a specific tracking plan. For its rules, use list_tracking_plan_rules.

Class `read` (reads only). No scopes beyond the connection's defaults. Calls `GET /tracking-plans/{{params.tracking_plan_id}}`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `tracking_plan_id` | string | **yes** | Segment tracking plan id, e.g. "rs_2VbA1u9ZpQx7Nk". |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.trackingPlan` | object |  |
| `data.trackingPlan.description` | string |  |
| `data.trackingPlan.id` | string |  |
| `data.trackingPlan.name` | string |  |
| `data.trackingPlan.updatedAt` | string |  |

Also retrieved by: "pull up the details on this governance spec", "what does this event spec cover", "when was this schema doc last touched".

### `segment.list_tracking_plans`

List tracking plans in the workspace. Use when the user asks what tracking plans exist, or wants to browse them before picking one to edit or attach a source to.

Class `read` (reads only). No scopes beyond the connection's defaults. Calls `GET /tracking-plans`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `limit` | integer | no | Results per page. Defaults to 50. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.trackingPlans` | array of object |  |
| `data.trackingPlans[].id` | string |  |
| `data.trackingPlans[].name` | string |  |

Also retrieved by: "what schemas do we have defined", "show every governance plan in the workspace", "browse the specs we're enforcing across the team".

### `segment.update_tracking_plan`

Rename a tracking plan or change its description. Use when the user wants to edit a tracking plan's name or documentation. For its rules, use upsert_tracking_plan_rule instead.

Class `write` (writes, no confirmation needed). Scopes `tracking-plans:write`. Calls `PATCH /tracking-plans/{{params.tracking_plan_id}}`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `description` | string | no | New description text. |
| `name` | string | no | New display name. |
| `tracking_plan_id` | string | **yes** | Segment tracking plan id to update. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.trackingPlan` | object |  |
| `data.trackingPlan.description` | string |  |
| `data.trackingPlan.id` | string |  |
| `data.trackingPlan.name` | string |  |

Also retrieved by: "rename this event spec", "update the description on our schema doc", "change what this governance doc is called".

### `segment.delete_tracking_plan`

Permanently delete a tracking plan and every rule it holds. Irreversible; sources connected to it stop being validated against it. Use only when the user explicitly asks to delete or remove a tracking plan entirely.

Class `destructive` (held by the mutation gate until the call's own arguments carry `"confirm": true`). Scopes `tracking-plans:write`. Calls `DELETE /tracking-plans/{{params.tracking_plan_id}}`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `tracking_plan_id` | string | **yes** | Segment tracking plan id to delete. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `deleted` | boolean |  |

Also retrieved by: "scrap this whole schema spec", "remove this governance plan and everything in it", "wipe out this data governance doc for good".

### `segment.list_tracking_plan_rules`

List the event rules in a tracking plan: each rule's event key, call type (track, identify, group, page, screen, or alias), and validation schema. Use when the user asks what events a tracking plan defines, wants every event definition it holds, or wants to check whether a specific event already has a rule.

Class `read` (reads only). No scopes beyond the connection's defaults. Calls `GET /tracking-plans/{{params.tracking_plan_id}}/rules`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `tracking_plan_id` | string | **yes** | Segment tracking plan id to list rules for. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.rules` | array of object |  |
| `data.rules[].jsonSchema` | object |  |
| `data.rules[].key` | string |  |
| `data.rules[].type` | string |  |
| `data.rules[].version` | integer |  |

Also retrieved by: "what events does this plan actually define", "is there already a schema for the signup event", "show every rule this spec enforces".

### `segment.upsert_tracking_plan_rule`

Add or update the validation rule for one event in a tracking plan, defining what a valid track, identify, group, page, screen, or alias call for that event must look like. Use when the user wants to define, approve, or change the schema for a specific event name. This is how a track/identify/group/page event gets governed, not how one is sent live.

Class `write` (writes, no confirmation needed). Scopes `tracking-plans:write`. Calls `PATCH /tracking-plans/{{params.tracking_plan_id}}/rules`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `event_key` | string | **yes** | Event name the rule governs, e.g. "Order Completed". |
| `event_type` | string, one of TRACK, IDENTIFY, GROUP, PAGE, SCREEN, ALIAS | **yes** | Which kind of call this rule validates. |
| `json_schema` | object | **yes** | JSON Schema the event's properties or traits must satisfy. |
| `tracking_plan_id` | string | **yes** | Segment tracking plan id to add the rule to. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.rules` | array of object |  |
| `data.rules[].key` | string |  |
| `data.rules[].type` | string |  |
| `data.rules[].version` | integer |  |

Also retrieved by: "define what a valid signup event should contain", "lock in the required fields for this event name", "approve the shape of this specific event", "set the schema for what counts as a real page view here".

### `segment.delete_tracking_plan_rule`

Remove the validation rule for one event from a tracking plan. Irreversible; that event stops being checked against a schema. Use when the user wants to drop, retire, or stop enforcing a rule for a specific event name.

Class `destructive` (held by the mutation gate until the call's own arguments carry `"confirm": true`). Scopes `tracking-plans:write`. Calls `DELETE /tracking-plans/{{params.tracking_plan_id}}/rules`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `event_key` | string | **yes** | Event name whose rule should be removed. |
| `event_type` | string, one of TRACK, IDENTIFY, GROUP, PAGE, SCREEN, ALIAS | **yes** | Which kind of call the rule being removed validates. |
| `tracking_plan_id` | string | **yes** | Segment tracking plan id the rule belongs to. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `deleted` | boolean |  |

Also retrieved by: "stop enforcing a schema on this event name", "drop the validation rule for this one event", "let this specific event through unchecked from now on".

### `segment.connect_source_to_tracking_plan`

Attach a source to a tracking plan, so events coming from it are validated against the plan's rules. Use when the user wants to apply, enforce, or turn on a tracking plan for a specific source.

Class `write` (writes, no confirmation needed). Scopes `tracking-plans:write`. Calls `POST /tracking-plans/{{params.tracking_plan_id}}/sources`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `source_ids` | array of string | **yes** | One or more Segment source ids to connect to this plan. |
| `tracking_plan_id` | string | **yes** | Segment tracking plan id to attach. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.connections` | array of object |  |
| `data.connections[].sourceId` | string |  |

Also retrieved by: "make this app follow our event spec", "enforce the governance plan on this input", "apply this schema to a specific source".

### `segment.list_tracking_plan_sources`

List the sources a tracking plan is attached to. Use when the user asks which sources a tracking plan governs, or wants to check before disconnecting one.

Class `read` (reads only). No scopes beyond the connection's defaults. Calls `GET /tracking-plans/{{params.tracking_plan_id}}/sources`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `tracking_plan_id` | string | **yes** | Segment tracking plan id to list connected sources for. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.sources` | array of object |  |
| `data.sources[].sourceId` | string |  |

Also retrieved by: "which apps are following this schema", "what's this governance plan actually enforced on", "show everything checked against this spec right now".

### `segment.disconnect_source_from_tracking_plan`

Detach a source from a tracking plan. Its events stop being validated against that plan's rules, which can let previously rejected event shapes through unnoticed. Use when the user wants to unlink, remove, or stop enforcing a tracking plan on a source.

Class `destructive` (held by the mutation gate until the call's own arguments carry `"confirm": true`). Scopes `tracking-plans:write`. Calls `DELETE /tracking-plans/{{params.tracking_plan_id}}/sources`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `source_ids` | array of string | **yes** | One or more Segment source ids to disconnect. |
| `tracking_plan_id` | string | **yes** | Segment tracking plan id to detach from. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `deleted` | boolean |  |

Also retrieved by: "stop checking this app's data against the spec", "unlink this source from the governance plan", "this app no longer needs to follow that schema".

### `segment.list_warehouses`

List data warehouses connected to the workspace. Use when the user asks what warehouses Segment syncs data to, or wants to pick one to inspect further.

Class `read` (reads only). No scopes beyond the connection's defaults. Calls `GET /warehouses`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `limit` | integer | no | Results per page. Defaults to 50. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.warehouses` | array of object |  |
| `data.warehouses[].id` | string |  |
| `data.warehouses[].name` | string |  |

Also retrieved by: "what data warehouses are we synced to", "show every place our data gets loaded into", "browse all our database sync targets".

### `segment.get_warehouse`

Get one warehouse by id: its name and sync settings. Use when the user names a specific warehouse rather than browsing all of them.

Class `read` (reads only). No scopes beyond the connection's defaults. Calls `GET /warehouses/{{params.warehouse_id}}`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `warehouse_id` | string | **yes** | Segment warehouse id, e.g. "wh_2VbA1u9ZpQx7Nk". |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.warehouse` | object |  |
| `data.warehouse.id` | string |  |
| `data.warehouse.name` | string |  |
| `data.warehouse.settings` | object |  |

Also retrieved by: "check the sync settings on this warehouse", "pull up details for this specific warehouse connection", "what database is this one actually pointed at".

### `segment.create_warehouse`

Connect a new data warehouse to the workspace so Segment can sync data into it. Use when the user wants to add, connect, or set up a new warehouse destination such as a SQL data warehouse.

Class `write` (writes, no confirmation needed). Scopes `warehouses:write`. Calls `POST /warehouses`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `metadata_id` | string | **yes** | Segment catalog id for the warehouse type. |
| `name` | string | **yes** | Display name for the warehouse connection. |
| `settings` | object | no | Warehouse-specific connection settings, e.g. host and database. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.warehouse` | object |  |
| `data.warehouse.id` | string |  |
| `data.warehouse.name` | string |  |

Also retrieved by: "hook up a new data warehouse for syncing", "connect our database so data lands there too", "set up a new sync target for our analytics database".

### `segment.delete_warehouse`

Permanently disconnect a warehouse. Irreversible; syncing into it stops and the connection settings are not recoverable. Use only when the user explicitly asks to remove a warehouse entirely.

Class `destructive` (held by the mutation gate until the call's own arguments carry `"confirm": true`). Scopes `warehouses:write`. Calls `DELETE /warehouses/{{params.warehouse_id}}`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `warehouse_id` | string | **yes** | Segment warehouse id to delete. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `deleted` | boolean |  |

Also retrieved by: "cut the sync to this warehouse for good", "disconnect this database entirely", "stop loading data into this destination database".

### `segment.list_labels`

List the workspace labels available to tag sources with, e.g. team or environment labels. Use when the user asks what labels exist before tagging or filtering sources by one.

Class `read` (reads only). No scopes beyond the connection's defaults. Calls `GET /labels`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `limit` | integer | no | Results per page. Defaults to 50. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.labels` | array of object |  |
| `data.labels[].description` | string |  |
| `data.labels[].key` | string |  |
| `data.labels[].value` | string |  |

Also retrieved by: "what tags can we put on our sources", "show the labels available for organizing apps", "browse the categories we can file things under".

### `segment.get_event_volume`

Get how many events the workspace received over time, optionally filtered by source or event name. Use when the user asks whether data is flowing at all, wants to check tracking volume, or is debugging why a source looks quiet.

Class `read` (reads only). No scopes beyond the connection's defaults. Calls `GET /events/volume`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `end_date` | string | no | End of the date range, e.g. "2026-07-30". |
| `event` | string | no | Only count this specific event name. |
| `source_id` | string | no | Only count events from this source id. |
| `start_date` | string | no | Start of the date range, e.g. "2026-07-01". |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `data` | object |  |
| `data.volume` | array of object |  |
| `data.volume[].count` | integer |  |
| `data.volume[].timestamp` | string |  |

Also retrieved by: "is data actually flowing right now", "why does this app look quiet lately", "how many events came in this week", "check whether tracking is actually working".
