show_track
Retrieve a track instance by its ID, including description, date, direction, and associated tasks. Use this to view track details without entity or completion information.
Instructions
Fetch a single track instance by id. Returns the minimal Capsule projection: id, description, trackDateOn, direction, and the array of tasks attached to the track. Capsule's GET /tracks/{id} does NOT include a trackDefinition link, an entity reference, or a completion field — to find the entity a track is applied to, use list_entity_tracks (which lists track instances by their parent entity); to check completion, the track-tasks' own statuses are the proxy.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| trackId | Yes |
Implementation Reference
- src/tools/tracks.ts:51-58 (schema)Zod schema for show_track (requires trackId: positive integer) and handler function that calls capsuleGet on GET /tracks/{id}
export const showTrackSchema = z.object({ trackId: z.number().int().positive(), }); export async function showTrack(input: z.infer<typeof showTrackSchema>) { const { data } = await capsuleGet<{ track: unknown }>(`/tracks/${input.trackId}`); return data; } - src/tools/tracks.ts:55-58 (handler)Handler function that executes show_track logic: makes a GET request to /tracks/{trackId} and returns the track data
export async function showTrack(input: z.infer<typeof showTrackSchema>) { const { data } = await capsuleGet<{ track: unknown }>(`/tracks/${input.trackId}`); return data; } - src/server.ts:927-933 (registration)Registration of the show_track tool with description, schema, and handler via registerTool helper
registerTool( server, "show_track", "Fetch a single track instance by id. Returns the minimal Capsule projection: id, description, trackDateOn, direction, and the array of tasks attached to the track. Capsule's GET /tracks/{id} does NOT include a trackDefinition link, an entity reference, or a completion field — to find the entity a track is applied to, use list_entity_tracks (which lists track instances by their parent entity); to check completion, the track-tasks' own statuses are the proxy.", showTrackSchema, showTrack, ); - src/server.ts:172-177 (helper)Import of showTrackSchema and showTrack from ./tools/tracks.js into the server
import { listEntityTracksSchema, listEntityTracks, showTrackSchema, showTrack, applyTrackSchema, - src/server/register-tool.ts:39-59 (helper)The registerTool helper function that wraps handlers in MCP text-content responses and registers them with the McpServer
export function registerTool<Schema extends z.ZodObject<ZodRawShape>>( server: McpServer, name: string, description: string, schema: Schema, handler: (input: z.infer<Schema>) => Promise<unknown>, ): void { // Use the SDK config-form registerTool with the full Zod schema. The // deprecated shape overload rebuilds z.object(schema.shape), which drops // object-level refinements such as superRefine. const registerWithSchema = server.registerTool.bind(server) as ( toolName: string, config: { description: string; inputSchema: Schema }, callback: (input: z.infer<Schema>) => Promise<CallToolResult>, ) => void; registerWithSchema(name, { description, inputSchema: schema }, async (input) => { const result = await handler(input); return wrapAsText(result); }); }