delete_version
Remove a version from a Backlog project by specifying the version ID to manage project timelines and maintain accurate version tracking.
Instructions
Deletes a version from a project
Input Schema
TableJSON 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., 'PROJECT') | |
| id | Yes | The numeric ID of the version to delete (e.g., 67890) |
Implementation Reference
- src/tools/deleteVersion.ts:37-69 (handler)Core implementation of the 'delete_version' tool as deleteVersionTool factory, defining name, schema, description, output schema, and the handler function that resolves the project ID/key and calls backlog.deleteVersions(projectId, versionId).export const deleteVersionTool = ( backlog: Backlog, { t }: TranslationHelper ): ToolDefinition< ReturnType<typeof deleteVersionSchema>, (typeof VersionSchema)['shape'] > => { return { name: 'delete_version', description: t( 'TOOL_DELETE_VERSION_DESCRIPTION', 'Deletes a version from a project' ), schema: z.object(deleteVersionSchema(t)), outputSchema: VersionSchema, handler: async ({ projectId, projectKey, id }) => { const result = resolveIdOrKey( 'project', { id: projectId, key: projectKey }, t ); if (!result.ok) { throw result.error; } if (!id) { throw new Error( t('TOOL_DELETE_VERSION_MISSING_ID', 'Version ID is required') ); } return backlog.deleteVersions(result.value, id); }, }; };
- src/tools/deleteVersion.ts:8-35 (schema)Zod schema definition for the delete_version tool inputs: optional projectId or projectKey, required version id.const deleteVersionSchema = buildToolSchema((t) => ({ projectId: z .number() .optional() .describe( t( 'TOOL_DELETE_VERSION_PROJECT_ID', 'The numeric ID of the project (e.g., 12345)' ) ), projectKey: z .string() .optional() .describe( t( 'TOOL_DELETE_VERSION_PROJECT_KEY', "The key of the project (e.g., 'PROJECT')" ) ), id: z .number() .describe( t( 'TOOL_DELETE_VERSION_ID', 'The numeric ID of the version to delete (e.g., 67890)' ) ), }));
- src/tools/tools.ts:56-56 (registration)Import of deleteVersionTool for registration.import { deleteVersionTool } from './deleteVersion.js';
- src/tools/tools.ts:115-115 (registration)Registration of deleteVersionTool instance in the 'issue' toolset of allTools.deleteVersionTool(backlog, helper),