Skip to main content
Glama
nulab

Backlog MCP Server

get_git_repository

Retrieve details of a specific Git repository by providing project ID, project key, repository ID or name. Returns information such as name, URL, and description.

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
organizationNoOptional organization name. Use list_organizations to inspect available organizations.

Implementation Reference

  • The handler function for the 'get_git_repository' tool. It resolves the project (by ID or key) and repository (by ID or name), then calls backlog.getGitRepository().
    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));
    },
  • Input schema defined via buildToolSchema: accepts projectId (number, optional), projectKey (string, optional), repoId (number, optional), repoName (string, optional). At least one of projectId or projectKey must be provided, and one of repoId or 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')),
    }));
  • Output schema (GitRepositorySchema) defining the shape of the returned Git repository object with fields: id, projectId, name, description, hookUrl, httpUrl, sshUrl, displayOrder, pushedAt, createdUser, created, updatedUser, updated.
    export const GitRepositorySchema = z.object({
      id: z.number(),
      projectId: z.number(),
      name: z.string(),
      description: z.string(),
      hookUrl: z.string().optional(),
      httpUrl: z.string(),
      sshUrl: z.string(),
      displayOrder: z.number(),
      pushedAt: z.string().optional(),
      createdUser: UserSchema,
      created: z.string(),
      updatedUser: UserSchema,
      updated: z.string(),
    });
  • Import and registration of getGitRepositoryTool. Imported at line 17 and registered as part of the 'git' toolset (line 143) in the allTools function.
    import { getGitRepositoryTool } from './getGitRepository.js';
    import { getIssueTool } from './getIssue.js';
    import { getIssueCommentsTool } from './getIssueComments.js';
    import { getIssuesTool } from './getIssues.js';
    import { getIssueTypesTool } from './getIssueTypes.js';
    import { getMyselfTool } from './getMyself.js';
    import { getNotificationsTool } from './getNotifications.js';
    import { getNotificationsCountTool } from './getNotificationsCount.js';
    import { getPrioritiesTool } from './getPriorities.js';
    import { getProjectTool } from './getProject.js';
    import { getProjectListTool } from './getProjectList.js';
    import { getPullRequestTool } from './getPullRequest.js';
    import { getPullRequestCommentsTool } from './getPullRequestComments.js';
    import { getPullRequestsTool } from './getPullRequests.js';
    import { getPullRequestsCountTool } from './getPullRequestsCount.js';
    import { getResolutionsTool } from './getResolutions.js';
    import { getSpaceTool } from './getSpace.js';
    import { getSpaceActivitiesTool } from './getSpaceActivities.js';
    import { getUserStarsCountTool } from './getUserStarsCount.js';
    import { getUsersTool } from './getUsers.js';
    import { getUserRecentUpdatesTool } from './getUserRecentUpdates.js';
    import { getWatchingListCountTool } from './getWatchingListCount.js';
    import { getWatchingListItemsTool } from './getWatchingListItems.js';
    import { addWatchingTool } from './addWatching.js';
    import { updateWatchingTool } from './updateWatching.js';
    import { deleteWatchingTool } from './deleteWatching.js';
    import { markWatchingAsReadTool } from './markWatchingAsRead.js';
    import { getWikiTool } from './getWiki.js';
    import { getWikiPagesTool } from './getWikiPages.js';
    import { getWikisCountTool } from './getWikisCount.js';
    import { markNotificationAsReadTool } from './markNotificationAsRead.js';
    import { resetUnreadNotificationCountTool } from './resetUnreadNotificationCount.js';
    import { updateIssueTool } from './updateIssue.js';
    import { updateProjectTool } from './updateProject.js';
    import { updatePullRequestTool } from './updatePullRequest.js';
    import { updatePullRequestCommentTool } from './updatePullRequestComment.js';
    import { getDocumentTool } from './getDocument.js';
    import { getDocumentsTool } from './getDocuments.js';
    import { getDocumentTreeTool } from './getDocumentTree.js';
    import { getVersionMilestoneListTool } from './getVersionMilestoneList.js';
    import { addVersionMilestoneTool } from './addVersionMilestone.js';
    import { updateVersionMilestoneTool } from './updateVersionMilestone.js';
    import { deleteVersionTool } from './deleteVersion.js';
    import { addDocumentTool } from './addDocument.js';
    
    export const allTools = (
      backlog: Backlog,
      helper: TranslationHelper
    ): ToolsetGroup => {
      return {
        toolsets: [
          {
            name: 'space',
            description:
              'Tools for managing Backlog space settings and general information.',
            enabled: false,
            tools: [
              getSpaceTool(backlog, helper),
              getSpaceActivitiesTool(backlog, helper),
              getUsersTool(backlog, helper),
              getUserStarsCountTool(backlog, helper),
              getMyselfTool(backlog, helper),
              getUserRecentUpdatesTool(backlog, helper),
            ],
          },
          {
            name: 'project',
            description:
              'Tools for managing projects, categories, custom fields, and issue types.',
            enabled: false,
            tools: [
              getProjectListTool(backlog, helper),
              addProjectTool(backlog, helper),
              getProjectTool(backlog, helper),
              updateProjectTool(backlog, helper),
              deleteProjectTool(backlog, helper),
            ],
          },
          {
            name: 'issue',
            description: 'Tools for managing issues and their comments.',
            enabled: false,
            tools: [
              getIssueTool(backlog, helper),
              getIssuesTool(backlog, helper),
              countIssuesTool(backlog, helper),
              addIssueTool(backlog, helper),
              updateIssueTool(backlog, helper),
              deleteIssueTool(backlog, helper),
              getIssueCommentsTool(backlog, helper),
              addIssueCommentTool(backlog, helper),
              getPrioritiesTool(backlog, helper),
              getCategoriesTool(backlog, helper),
              getCustomFieldsTool(backlog, helper),
              getIssueTypesTool(backlog, helper),
              getResolutionsTool(backlog, helper),
              getWatchingListItemsTool(backlog, helper),
              getWatchingListCountTool(backlog, helper),
              addWatchingTool(backlog, helper),
              updateWatchingTool(backlog, helper),
              deleteWatchingTool(backlog, helper),
              markWatchingAsReadTool(backlog, helper),
              getVersionMilestoneListTool(backlog, helper),
              addVersionMilestoneTool(backlog, helper),
              updateVersionMilestoneTool(backlog, helper),
              deleteVersionTool(backlog, helper),
            ],
          },
          {
            name: 'wiki',
            description: 'Tools for managing wiki pages.',
            enabled: false,
            tools: [
              getWikiPagesTool(backlog, helper),
              getWikisCountTool(backlog, helper),
              getWikiTool(backlog, helper),
              addWikiTool(backlog, helper),
              updateWikiTool(backlog, helper),
            ],
          },
          {
            name: 'git',
            description: 'Tools for managing Git repositories and pull requests.',
            enabled: false,
            tools: [
              getGitRepositoriesTool(backlog, helper),
              getGitRepositoryTool(backlog, helper),
  • Helper functions resolveIdOrKey and resolveIdOrName used by the handler to resolve project (by id or key) and repository (by id or name) identifiers.
    function resolveIdOrField<E extends EntityName, F extends string>(
      entity: E,
      fieldName: F,
      values: ResolveIdOrFieldInput<F>,
      t: TranslationHelper['t']
    ): ResolveResult {
      const value = tryResolveIdOrField(fieldName, values);
      if (value === undefined) {
        return {
          ok: false,
          error: new Error(
            t(
              `${entity.toUpperCase()}_ID_OR_${fieldName.toUpperCase()}_REQUIRED`,
              `${capitalize(entity)} ID or ${fieldName} is required`
            )
          ),
        };
      }
    
      return { ok: true, value };
    }
    
    function tryResolveIdOrField<F extends string>(
      fieldName: F,
      values: ResolveIdOrFieldInput<F>
    ): string | number | undefined {
      return values.id !== undefined ? values.id : values[fieldName];
    }
    
    export const resolveIdOrKey = <E extends EntityName>(
      entity: E,
      values: { id?: number; key?: string },
      t: TranslationHelper['t']
    ): ResolveResult => resolveIdOrField(entity, 'key', values, t);
    
    export const resolveIdOrName = <E extends EntityName>(
      entity: E,
      values: { id?: number; name?: string },
      t: TranslationHelper['t']
    ): ResolveResult => resolveIdOrField(entity, 'name', values, t);
    
    function capitalize(str: string): string {
      return str.charAt(0).toUpperCase() + str.slice(1);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It only states 'returns information' without disclosing side effects, required permissions, or any behavioral traits beyond a simple read operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very short (one sentence) and front-loaded, but it is too terse and lacks additional context that would make it more helpful. It is not explicitly concise to the point of omitting necessary details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no output schema, the description should explain what the returned 'information' includes. Without this, the description feels incomplete for an agent to understand the tool's output.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters. The description adds no additional meaning or usage details beyond what is in the schema, meeting the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the verb 'returns' and specifies the resource 'a specific Git repository', clearly differentiating from the sibling tool 'get_git_repositories' which likely lists repositories. However, it could be more precise about what information is returned.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives such as get_git_repositories. No context on prerequisites or typical use cases is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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