get-objective
Retrieve Shortcut project objectives using their public ID to access detailed information and manage project tracking.
Instructions
Get a Shortcut objective by public ID
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| objectivePublicId | Yes | The public ID of the objective to get |
Input Schema (JSON Schema)
{
"properties": {
"objectivePublicId": {
"description": "The public ID of the objective to get",
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"objectivePublicId"
],
"type": "object"
}
Implementation Reference
- src/tools/objectives.ts:71-81 (handler)The handler function getObjective that retrieves the Shortcut objective (milestone) by its public ID using the injected client, handles missing objectives, and formats the result using inherited helper 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:12-19 (registration)Registers the "get-objective" MCP tool with the server, providing the tool name, description, input schema (objectivePublicId as positive number), and a thin async handler that delegates to the getObjective method.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), );
- src/tools/objectives.ts:15-17 (schema)Zod input schema for the get-objective tool, validating objectivePublicId as a positive number.{ objectivePublicId: z.number().positive().describe("The public ID of the objective to get"), },