Skip to main content
Glama
DrBalls

n8n MCP Server

by DrBalls

Get Source Control Status

n8n_source_control_status
Read-onlyIdempotent

Check Git repository status in n8n workflows to monitor branch, remote sync, and merge conflicts for automation management.

Instructions

Get the current source control (Git) status.

Returns:

  • branchName: Current branch

  • connected: Whether Git is connected

  • ahead: Commits ahead of remote

  • behind: Commits behind remote

  • conflicts: Any merge conflicts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the 'n8n_source_control_status' tool by fetching the status from the n8n API.
    async () => {
      const status = await get<N8nSourceControlStatus>('/source-control/status');
      
      const text = [
        `**Source Control Status**`,
        `- Branch: ${status.branchName}`,
        `- Connected: ${status.connected ? '✅ Yes' : '❌ No'}`,
        `- Commits Ahead: ${status.ahead}`,
        `- Commits Behind: ${status.behind}`,
        status.conflicts?.length ? `- Conflicts: ${status.conflicts.join(', ')}` : ''
      ].filter(Boolean).join('\n');
      
      return {
        content: [{ type: 'text', text }],
        structuredContent: status
      };
    }
  • Registration of the 'n8n_source_control_status' tool within the server instance.
      // ============ Get Source Control Status ============
      server.registerTool(
        'n8n_source_control_status',
        {
          title: 'Get Source Control Status',
          description: `Get the current source control (Git) status.
    
    Returns:
      - branchName: Current branch
      - connected: Whether Git is connected
      - ahead: Commits ahead of remote
      - behind: Commits behind remote
      - conflicts: Any merge conflicts`,
          inputSchema: EmptySchema,
          annotations: {
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
            openWorldHint: false
          }
        },
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=false, covering safety and idempotency. The description adds value by specifying the return structure (branchName, connected, ahead, behind, conflicts), which is useful context beyond annotations, though it doesn't mention rate limits or authentication needs.

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 front-loaded with the core purpose in the first sentence, followed by a bulleted list of return values. Every sentence earns its place, with no wasted words, making it highly efficient and well-structured.

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

Completeness4/5

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

Given the tool's simplicity (0 parameters, no output schema) and rich annotations, the description is mostly complete. It explains what the tool does and what it returns, though it could benefit from more explicit usage guidelines or prerequisites. The lack of an output schema is compensated by the detailed return description.

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

Parameters4/5

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

With 0 parameters and 100% schema description coverage, the baseline is 4. The description doesn't need to explain parameters, and it appropriately focuses on the tool's purpose and output without redundant parameter information.

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

Purpose5/5

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

The description clearly states the specific action ('Get the current source control (Git) status') and resource ('source control'), distinguishing it from siblings like n8n_source_control_pull or n8n_source_control_disconnect. It precisely communicates what the tool does without being vague or tautological.

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

Usage Guidelines3/5

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

The description implies usage for checking Git status, but doesn't explicitly state when to use this tool versus alternatives (e.g., n8n_source_control_pull for updates or n8n_check_connection for general connectivity). It provides basic context but lacks explicit guidance on exclusions or comparisons with sibling tools.

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/DrBalls/n8n-mcp-server-v2'

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