backlog_get_projects
Retrieve project details from Backlog API, filtering by archived status or administrator access. Supports pagination with a maximum of 20 results per request and offset functionality for efficient data handling.
Instructions
Performs list project get using the Backlog Projects get API. Supports pagination, content filtering. Maximum 20 results per request, with offset for pagination.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| all | No | Only applies to administrators. If true, it returns all projects. If false, it returns only projects they have joined (set to false by default). | |
| archived | No | For unspecified parameters, this form returns all projects. For false parameters, it returns unarchived projects. For true parameters, it returns archived projects. |
Implementation Reference
- src/tools/handlers.ts:34-66 (handler)The main handler function for the 'backlog_get_projects' tool. It validates input parameters using ProjectsParamsSchema, calls projectService.getProjects, and formats the response as MCP content.const handleGetProjects: ToolHandler = async (args) => { try { try { const validatedParams = ProjectsParamsSchema.parse(args); const text = await projectService.getProjects(validatedParams); return { content: [ { type: "text", text: `Results for your query:\n${text}`, }, ], isError: false, }; } catch (validationError) { throw new ValidationError( `Invalid parameters: ${validationError instanceof Error ? validationError.message : String(validationError)}`, ); } } catch (error) { return { content: [ { type: "text", text: `Error: ${formatError(error)}`, }, ], isError: true, }; } };
- src/tools/handlers.ts:442-455 (registration)Maps the tool name 'backlog_get_projects' to its handler function handleGetProjects in the toolHandlers registry.export const toolHandlers: Record<ToolName, ToolHandler> = { backlog_get_projects: handleGetProjects, backlog_get_project: handleGetProject, backlog_get_issues: handleGetIssues, backlog_get_issue: handleGetIssue, backlog_add_issue: handleAddIssue, backlog_update_issue: handleUpdateIssue, backlog_delete_issue: handleDeleteIssue, backlog_get_wikis: handleGetWikis, backlog_get_wiki: handleGetWiki, backlog_add_wiki: handleAddWiki, backlog_update_wiki: handleUpdateWiki, backlog_delete_wiki: handleDeleteWiki, };
- src/core/schema.ts:107-121 (schema)Zod schema for input validation of the backlog_get_projects tool parameters: archived (boolean, optional), all (boolean, optional, default false).export const ProjectsParamsSchema = z.object({ archived: z .boolean() .optional() .describe( "For unspecified parameters, this form returns all projects. For false parameters, it returns unarchived projects. For true parameters, it returns archived projects.", ), all: z .boolean() .optional() .default(false) .describe( "Only applies to administrators. If true, it returns all projects. If false, it returns only projects they have joined (set to false by default).", ), });
- src/tools/toolDefinitions.ts:525-531 (registration)MCP Tool definition for 'backlog_get_projects', including name, description, and inputSchema derived from ProjectsParamsSchema.export const PROJECTS_TOOL: Tool = createTool( "backlog_get_projects", "Performs list project get using the Backlog Projects get API. " + "Supports pagination, content filtering. " + "Maximum 20 results per request, with offset for pagination.", ProjectsParamsSchema, );
- src/tools/registry.ts:38-38 (registration)Initializes the ToolRegistry with ALL_TOOLS, which includes the backlog_get_projects tool.export const toolRegistry = new ToolRegistry(ALL_TOOLS);