list_entity_tracks
List all track instances applied to a specific entity record, including auto-applied tracks from board rules. Identify source by comparing track definition IDs.
Instructions
List track INSTANCES on a specific record — i.e., which tracks have been applied to this opportunity / project / party. Distinct from list_track_definitions, which lists the templates. NOTE: some boards have stage-triggered automation that auto-applies tracks when an entity enters specific stages — tracks returned here may include BOTH manually-applied tracks (via apply_track) and auto-applied tracks from Capsule board rules. To distinguish, compare each track's trackDefinition.id against your application's apply_track call history.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entity | Yes | Use 'kases' for projects. | |
| entityId | Yes |
Implementation Reference
- src/tools/tracks.ts:42-47 (handler)Handler function that calls capsuleGet to fetch track instances for a specific entity record via GET /{entity}/{entityId}/tracks.
export async function listEntityTracks(input: z.infer<typeof listEntityTracksSchema>) { const { data } = await capsuleGet<{ tracks: unknown[] }>( `/${input.entity}/${input.entityId}/tracks`, ); return data; } - src/tools/tracks.ts:37-40 (schema)Zod schema for list_entity_tracks input validation: entity (enum: parties, opportunities, kases) and entityId (positive integer).
export const listEntityTracksSchema = z.object({ entity: TrackEntity, entityId: z.number().int().positive(), }); - src/server.ts:919-924 (registration)Registration of the tool with the MCP server via registerTool helper, binding the name, description, schema, and handler together.
registerTool( server, "list_entity_tracks", "List track INSTANCES on a specific record — i.e., which tracks have been applied to this opportunity / project / party. Distinct from list_track_definitions, which lists the templates. NOTE: some boards have stage-triggered automation that auto-applies tracks when an entity enters specific stages — tracks returned here may include BOTH manually-applied tracks (via apply_track) and auto-applied tracks from Capsule board rules. To distinguish, compare each track's `trackDefinition.id` against your application's apply_track call history.", listEntityTracksSchema, listEntityTracks, - src/capsule/client.ts:344-355 (helper)Helper function capsuleGet that performs a GET request to the Capsule API, handling auth, URL building, response parsing, and pagination.
export async function capsuleGet<T>(path: string, params?: QueryParams): Promise<PagedResult<T>> { const token = getToken(); const url = buildUrl(path, params); const { res, cleanup } = await doFetch(url, { headers: baseHeaders(token) }); try { const data = await handleResponse<T>(res); const nextPage = parseNextPage(res.headers.get("Link")); return { data, nextPage }; } finally { cleanup(); } }