get_categories
Retrieve a list of categories for a specific project in Backlog by providing the project ID or key, enabling organized project management and issue categorization.
Instructions
Returns list of categories for a project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectIdOrKey | Yes | Project ID or project key |
Implementation Reference
- src/tools/getCategories.ts:45-55 (handler)The asynchronous handler function that executes the tool logic: resolves the project ID or key and fetches categories using the backlog client.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)Input schema definition using Zod for optional projectId (number) or projectKey (string). Used in the tool's schema: z.object(getCategoriesSchema(t)). Output schema is CategorySchema.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:97-97 (registration)The getCategoriesTool factory is called with backlog client and translation helper to instantiate and register the tool in the 'issue' toolset.getCategoriesTool(backlog, helper),