Skip to main content
Glama
ConnorBoetig-dev

Unrestricted Development MCP Server

git_show

Display detailed commit information including changes, author, and metadata to review code modifications and understand project history in your development environment.

Instructions

Show details of a commit

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commitNoCommit hash or reference to showHEAD
cwdNoRepository directory

Implementation Reference

  • The core handler function for the 'git_show' tool. It validates input using Zod schema and executes the 'git show' command via the executeGitCommand helper, returning formatted output or error.
    export async function gitShow(args: z.infer<typeof gitShowSchema>): Promise<ToolResponse> {
      return executeGitCommand(`git show ${args.commit}`, args.cwd);
    }
  • Zod schema for input validation of the git_show tool parameters (commit and cwd). Used in the dispatch handler to parse arguments before calling the main function.
    export const gitShowSchema = z.object({
      commit: z.string().optional().default('HEAD').describe('Commit hash or reference to show'),
      cwd: z.string().optional().describe('Repository directory')
    });
  • MCP tool registration definition in gitTools array, including name, description, and JSON inputSchema advertised to MCP clients.
    {
      name: 'git_show',
      description: 'Show details of a commit',
      inputSchema: {
        type: 'object',
        properties: {
          commit: { type: 'string', default: 'HEAD', description: 'Commit hash or reference to show' },
          cwd: { type: 'string', description: 'Repository directory' }
        }
      }
  • src/index.ts:433-436 (registration)
    Dispatch handler in main MCP server that routes 'git_show' tool calls, validates args with schema, and invokes the gitShow implementation.
    if (name === 'git_show') {
      const validated = gitShowSchema.parse(args);
      return await gitShow(validated);
    }
  • Shared helper function that executes git commands via child_process.exec, formats output as ToolResponse, and handles errors uniformly across all git tools.
    async function executeGitCommand(command: string, cwd?: string): Promise<ToolResponse> {
      try {
        const { stdout, stderr } = await execAsync(command, {
          cwd: cwd || process.cwd(),
          shell: '/bin/bash',
          maxBuffer: 10 * 1024 * 1024 // 10MB buffer
        });
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify({
                success: true,
                command: command,
                stdout: stdout.trim(),
                stderr: stderr.trim(),
                cwd: cwd || process.cwd()
              }, null, 2)
            }
          ]
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify({
                success: false,
                command: command,
                stdout: error.stdout?.trim() || '',
                stderr: error.stderr?.trim() || error.message,
                exitCode: error.code || 1,
                cwd: cwd || process.cwd()
              }, null, 2)
            }
          ],
          isError: true
        };
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Show details of a commit' implies a read-only operation, but it doesn't specify what details are returned (e.g., commit message, author, changes), whether it requires Git to be installed, or any error conditions. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero waste: 'Show details of a commit'. It's front-loaded and appropriately sized for a simple tool, making it easy to parse. Every word earns its place by conveying the core purpose without unnecessary elaboration.

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's complexity (a Git operation with 2 parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what 'details' are returned, potential errors, or dependencies like Git installation. For a tool with no structured behavioral data, the description should provide more context to be fully helpful.

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%, with both parameters ('commit' and 'cwd') fully described in the schema. The description adds no additional parameter semantics beyond what's in the schema. According to the rules, with high schema coverage (>80%), the baseline is 3 even without param info in the description, which fits here as the schema adequately documents the inputs.

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 'Show details of a commit' clearly states the verb ('Show') and resource ('details of a commit'), making the purpose immediately understandable. It distinguishes this from sibling Git tools like git_log (which lists commits) or git_diff (which shows changes), though it doesn't explicitly name these alternatives. The purpose is specific but could be more precise about what 'details' includes.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when git_show is appropriate compared to git_log (for commit summaries) or git_diff (for changes), nor does it specify prerequisites like needing a Git repository. Usage is implied by the name and purpose but not explicitly stated.

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/ConnorBoetig-dev/mcp2'

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