get-iteration
Retrieve a Shortcut iteration by its public ID using the get-iteration tool. Specify whether to return all fields or a slim version to customize the data output.
Instructions
Get a Shortcut iteration by public ID
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| full | No | True to return all iteration fields from the API. False to return a slim version that excludes uncommon fields | |
| iterationPublicId | Yes | The public ID of the iteration to get |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"full": {
"default": false,
"description": "True to return all iteration fields from the API. False to return a slim version that excludes uncommon fields",
"type": "boolean"
},
"iterationPublicId": {
"description": "The public ID of the iteration to get",
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"iterationPublicId"
],
"type": "object"
}
Implementation Reference
- src/tools/iterations.ts:150-162 (handler)Handler function that implements the logic to get a specific iteration by public ID, fetches from client, handles error, and formats response with related entities.async getIteration(iterationPublicId: number, full = false) { const iteration = await this.client.getIteration(iterationPublicId); if (!iteration) throw new Error( `Failed to retrieve Shortcut iteration with public ID: ${iterationPublicId}.`, ); return this.toResult( `Iteration: ${iterationPublicId}`, await this.entityWithRelatedEntities(iteration, "iteration", full), ); }
- src/tools/iterations.ts:30-44 (registration)MCP tool registration for 'iterations-get-by-id', which is the tool to get an iteration. Includes schema and points to the handler.server.addToolWithReadAccess( "iterations-get-by-id", "Get a Shortcut iteration by public ID", { iterationPublicId: z.number().positive().describe("The public ID of the iteration to get"), full: z .boolean() .optional() .default(false) .describe( "True to return all iteration fields from the API. False to return a slim version that excludes uncommon fields", ), }, async ({ iterationPublicId, full }) => await tools.getIteration(iterationPublicId, full), );
- src/tools/iterations.ts:33-42 (schema)Zod schema for input parameters of the get iteration tool: iterationPublicId (required number) and full (optional boolean).{ iterationPublicId: z.number().positive().describe("The public ID of the iteration to get"), full: z .boolean() .optional() .default(false) .describe( "True to return all iteration fields from the API. False to return a slim version that excludes uncommon fields", ), },
- src/client/shortcut.ts:238-239 (helper)Client wrapper method that calls the underlying Shortcut client to fetch the iteration.async getIteration(iterationPublicId: number) { const response = await this.client.getIteration(iterationPublicId);