Skip to main content
Glama
nulab

Backlog MCP Server

get_git_repositories

Retrieve Git repositories for a Backlog project using project ID or key to manage version-controlled code within project workflows.

Instructions

Returns list of Git repositories for a project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdNoThe numeric ID of the project (e.g., 12345)
projectKeyNoThe key of the project (e.g., 'PROJECT')

Implementation Reference

  • The handler function that resolves the project ID or key using resolveIdOrKey utility and calls backlog.getGitRepositories(result.value) to fetch the list of Git repositories.
    handler: async ({ projectId, projectKey }) => {
      const result = resolveIdOrKey(
        'project',
        { id: projectId, key: projectKey },
        t
      );
      if (!result.ok) {
        throw result.error;
      }
      return backlog.getGitRepositories(result.value);
    },
  • Input schema definition for the tool parameters: optional projectId (number) and projectKey (string), with descriptions translated via t function.
    const getGitRepositoriesSchema = buildToolSchema((t) => ({
      projectId: z
        .number()
        .optional()
        .describe(
          t(
            'TOOL_GET_GIT_REPOSITORIES_PROJECT_ID',
            'The numeric ID of the project (e.g., 12345)'
          )
        ),
      projectKey: z
        .string()
        .optional()
        .describe(
          t(
            'TOOL_GET_GIT_REPOSITORIES_PROJECT_KEY',
            "The key of the project (e.g., 'PROJECT')"
          )
        ),
    }));
  • Definition and export of the getGitRepositoriesTool function, which creates and returns the ToolDefinition object with name 'get_git_repositories', description, input/output schemas, and handler.
    export const getGitRepositoriesTool = (
      backlog: Backlog,
      { t }: TranslationHelper
    ): ToolDefinition<
      ReturnType<typeof getGitRepositoriesSchema>,
      (typeof GitRepositorySchema)['shape']
    > => {
      return {
        name: 'get_git_repositories',
        description: t(
          'TOOL_GET_GIT_REPOSITORIES_DESCRIPTION',
          'Returns list of Git repositories for a project'
        ),
        schema: z.object(getGitRepositoriesSchema(t)),
        outputSchema: GitRepositorySchema,
        handler: async ({ projectId, projectKey }) => {
          const result = resolveIdOrKey(
            'project',
            { id: projectId, key: projectKey },
            t
          );
          if (!result.ok) {
            throw result.error;
          }
          return backlog.getGitRepositories(result.value);
        },
      };
    };
  • The getGitRepositoriesTool is registered as part of the 'git' toolset group in the allTools function, which aggregates all available tools.
    {
      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),
      ],
    },

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