get_categories
Retrieve available categories for a Backlog project to organize and classify issues effectively. Provide either project ID or key to fetch category data.
Instructions
Returns list of categories for a project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | No | The numeric ID of the project (e.g., 12345) | |
| projectKey | No | The numeric ID of the project (e.g., 12345) |
Implementation Reference
- src/tools/getCategories.ts:45-55 (handler)The handler function that resolves the project ID or key using resolveIdOrKey and calls backlog.getCategories to retrieve the list of categories for the project.handler: async ({ projectId, projectKey }) => { const result = resolveIdOrKey( 'project', { id: projectId, key: projectKey }, t ); if (!result.ok) { throw result.error; } return backlog.getCategories(result.value); },
- src/tools/getCategories.ts:8-27 (schema)Defines the Zod input schema for the tool, accepting optional projectId (number) or projectKey (string).const getCategoriesSchema = buildToolSchema((t) => ({ projectId: z .number() .optional() .describe( t( 'TOOL_GET_CATEGORIES_PROJECT_ID', 'The numeric ID of the project (e.g., 12345)' ) ), projectKey: z .string() .optional() .describe( t( 'TOOL_GET_CATEGORIES_PROJECT_ID', "The key of the project (e.g., 'PROJECT')" ) ), }));
- src/tools/tools.ts:102-102 (registration)Registers the getCategoriesTool within the 'issue' toolset group by calling the factory function with backlog and translation helper.getCategoriesTool(backlog, helper),
- src/tools/tools.ts:14-14 (registration)Imports the getCategoriesTool factory from its module.import { getCategoriesTool } from './getCategories.js';
- src/tools/getCategories.ts:44-44 (schema)Specifies the output schema as CategorySchema for validation of the returned categories list.outputSchema: CategorySchema,