get-objective
Retrieve a Shortcut objective using its public ID to access project details and track progress within the MCP server.
Instructions
Get a Shortcut objective by public ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| objectivePublicId | Yes | The public ID of the objective to get |
Implementation Reference
- src/tools/objectives.ts:71-81 (handler)Handler function that fetches the Shortcut objective (milestone) by public ID using the client, handles errors, and formats the result using base tool methods.async getObjective(objectivePublicId: number) { const objective = await this.client.getMilestone(objectivePublicId); if (!objective) throw new Error(`Failed to retrieve Shortcut objective with public ID: ${objectivePublicId}`); return this.toResult( `Objective: ${objectivePublicId}`, await this.entityWithRelatedEntities(objective, "objective"), ); }
- src/tools/objectives.ts:15-17 (schema)Zod input schema defining the 'objectivePublicId' parameter for the get-objective tool.{ objectivePublicId: z.number().positive().describe("The public ID of the objective to get"), },
- src/tools/objectives.ts:12-19 (registration)Registers the 'get-objective' tool with the MCP server, specifying name, description, input schema, and delegating to the getObjective handler.server.tool( "get-objective", "Get a Shortcut objective by public ID", { objectivePublicId: z.number().positive().describe("The public ID of the objective to get"), }, async ({ objectivePublicId }) => await tools.getObjective(objectivePublicId), );