get_git_repository
Retrieve detailed information about a specific Git repository from Backlog projects using project ID, project key, repository ID, or repository name parameters.
Instructions
Returns information about a specific Git repository
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') | |
| repoId | No | Repository ID | |
| repoName | No | Repository name |
Implementation Reference
- src/tools/getGitRepository.ts:52-70 (handler)The asynchronous handler function that executes the tool logic: resolves project ID/key and repository ID/name, then calls the Backlog API's getGitRepository method.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)Zod schema definition for the tool's input parameters: projectId/projectKey and repoId/repoName.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:130-146 (registration)Registration of the getGitRepositoryTool within the 'git' toolset group in the allTools function.{ name: 'git', description: 'Tools for managing Git repositories and pull requests.', enabled: false, tools: [ getGitRepositoriesTool(backlog, helper), getGitRepositoryTool(backlog, helper), getPullRequestsTool(backlog, helper), getPullRequestsCountTool(backlog, helper), getPullRequestTool(backlog, helper), addPullRequestTool(backlog, helper), updatePullRequestTool(backlog, helper), getPullRequestCommentsTool(backlog, helper), addPullRequestCommentTool(backlog, helper), updatePullRequestCommentTool(backlog, helper), ], },
- src/tools/getGitRepository.ts:50-51 (schema)Tool schema instantiation and output schema reference (GitRepositorySchema).schema: z.object(getGitRepositorySchema(t)), outputSchema: GitRepositorySchema,
- src/tools/tools.ts:17-17 (registration)Import of the getGitRepositoryTool factory function.import { getGitRepositoryTool } from './getGitRepository.js';