Skip to main content
Glama
useshortcut

Shortcut MCP Server

Official
by useshortcut

objectives-get-by-id

Retrieve a specific Shortcut objective using its public ID to access project management data, with options for full or slim field returns.

Instructions

Get a Shortcut objective by public ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
objectivePublicIdYesThe public ID of the objective to get
fullNoTrue to return all objective fields from the API. False to return a slim version that excludes uncommon fields

Implementation Reference

  • The handler function 'getObjective' that fetches the Shortcut objective (milestone) by public ID using the client, handles errors, and formats the result using inherited methods.
    async getObjective(objectivePublicId: number, full = false) {
    	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", full),
    	);
    }
  • Input schema using Zod for the tool parameters: objectivePublicId (required positive number) and full (optional boolean, default false).
    {
    	objectivePublicId: z.number().positive().describe("The public ID of the objective to get"),
    	full: z
    		.boolean()
    		.optional()
    		.default(false)
    		.describe(
    			"True to return all objective fields from the API. False to return a slim version that excludes uncommon fields",
    		),
    },
  • Registration of the 'objectives-get-by-id' tool via server.addToolWithReadAccess, specifying name, description, input schema, and delegating to the getObjective handler.
    server.addToolWithReadAccess(
    	"objectives-get-by-id",
    	"Get a Shortcut objective by public ID",
    	{
    		objectivePublicId: z.number().positive().describe("The public ID of the objective to get"),
    		full: z
    			.boolean()
    			.optional()
    			.default(false)
    			.describe(
    				"True to return all objective fields from the API. False to return a slim version that excludes uncommon fields",
    			),
    	},
    	async ({ objectivePublicId, full }) => await tools.getObjective(objectivePublicId, full),
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/useshortcut/mcp-server-shortcut'

If you have feedback or need assistance with the MCP directory API, please join our Discord server