Skip to main content
Glama
nulab

Backlog MCP Server

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
NameRequiredDescriptionDefault
projectIdNoThe numeric ID of the project (e.g., 12345)
projectKeyNoThe key of the project (e.g., 'PROJECT')
repoIdNoRepository ID
repoNameNoRepository name

Implementation Reference

  • 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));
    },
  • 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')),
    }));
  • 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),
      ],
    },
  • Tool schema instantiation and output schema reference (GitRepositorySchema).
    schema: z.object(getGitRepositorySchema(t)),
    outputSchema: GitRepositorySchema,
  • Import of the getGitRepositoryTool factory function.
    import { getGitRepositoryTool } from './getGitRepository.js';

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nulab/backlog-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server