get_git_repository
Retrieve details of a specific Git repository by providing its project ID or key and repository ID or name using the Backlog MCP Server API integration.
Instructions
Returns information about a specific Git repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectIdOrKey | Yes | Project ID or project key | |
| repoIdOrName | Yes | Repository ID or name |
Implementation Reference
- src/tools/getGitRepository.ts:52-70 (handler)The main handler function for the get_git_repository tool. It resolves the project ID or key and repository ID or name using helper functions, then calls the Backlog API's getGitRepository method to retrieve the repository information.handler: async ({ projectId, projectKey, repoId, repoName }) => { const result = resolveIdOrKey( 'project', { id: projectId, key: projectKey }, t ); if (!result.ok) { throw result.error; } const repoResult = resolveIdOrName( 'repository', { id: repoId, name: repoName }, t ); if (!repoResult.ok) { throw repoResult.error; } return backlog.getGitRepository(result.value, String(repoResult.value)); },
- src/tools/getGitRepository.ts:8-35 (schema)Input schema for the get_git_repository tool using Zod, defining optional parameters for project (ID or key) and repository (ID or name).const getGitRepositorySchema = buildToolSchema((t) => ({ projectId: z .number() .optional() .describe( t( 'TOOL_GET_GIT_REPOSITORY_PROJECT_ID', 'The numeric ID of the project (e.g., 12345)' ) ), projectKey: z .string() .optional() .describe( t( 'TOOL_GET_GIT_REPOSITORY_PROJECT_KEY', "The key of the project (e.g., 'PROJECT')" ) ), repoId: z .number() .optional() .describe(t('TOOL_GET_GIT_REPOSITORY_REPO_ID', 'Repository ID')), repoName: z .string() .optional() .describe(t('TOOL_GET_GIT_REPOSITORY_REPO_NAME', 'Repository name')), }));
- src/tools/tools.ts:126-126 (registration)Registration of the getGitRepositoryTool within the 'git' toolset group in the allTools function.getGitRepositoryTool(backlog, helper),
- src/tools/tools.ts:16-16 (registration)Import of the getGitRepositoryTool from its implementation file.import { getGitRepositoryTool } from './getGitRepository.js';
- src/tools/getGitRepository.ts:51-51 (schema)Reference to the output schema (GitRepositorySchema) for the tool's response validation.outputSchema: GitRepositorySchema,