get_version_milestone_list
Retrieve a list of versions and milestones for a Backlog project by providing the project ID or key.
Instructions
Returns list of versions/milestones in the Backlog space
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | No | The numeric ID of the project (e.g., 12345) | |
| projectKey | No | The key of the project (e.g., TEST_PROJECT) | |
| organization | No | Optional organization name. Use list_organizations to inspect available organizations. |
Implementation Reference
- The handler function that executes the tool logic. It resolves projectId/projectKey via resolveIdOrKey, then calls backlog.getVersions() to retrieve version/milestone list.
handler: async ({ projectId, projectKey }) => { const result = resolveIdOrKey( 'project', { id: projectId, key: projectKey }, t ); if (!result.ok) { throw result.error; } return backlog.getVersions(result.value); }, - Input schema definition using Zod. Accepts optional 'projectId' (number) and 'projectKey' (string) parameters.
const getVersionMilestoneListSchema = buildToolSchema((t) => ({ projectId: z .number() .optional() .describe( t( 'TOOL_GET_VERSION_MILESTONE_PROJECT_ID', 'The numeric ID of the project (e.g., 12345)' ) ), projectKey: z .string() .optional() .describe( t( 'TOOL_GET_VERSION_MILESTONE_PROJECT_KEY', 'The key of the project (e.g., TEST_PROJECT)' ) ), })); - Output schema (VersionSchema) defining the structure of each version/milestone returned: id, projectId, name, description, startDate, releaseDueDate, archived, displayOrder.
export const VersionSchema = z.object({ id: z.number(), projectId: z.number(), name: z.string(), description: z.string().optional(), startDate: z.string().optional(), releaseDueDate: z.string().optional(), archived: z.boolean(), displayOrder: z.number(), }); - src/tools/tools.ts:119-123 (registration)Registration of get_version_milestone_list tool within the 'issue' toolset, instantiated with backlog and helper.
getVersionMilestoneListTool(backlog, helper), addVersionMilestoneTool(backlog, helper), updateVersionMilestoneTool(backlog, helper), deleteVersionTool(backlog, helper), ], - src/utils/resolveIdOrKey.ts:51-55 (helper)Helper utility resolveIdOrKey used by the handler to resolve either a numeric project ID or a string project key.
export const resolveIdOrKey = <E extends EntityName>( entity: E, values: { id?: number; key?: string }, t: TranslationHelper['t'] ): ResolveResult => resolveIdOrField(entity, 'key', values, t);