Skip to main content
Glama
aflsolutions

ShadowGit MCP Server

by aflsolutions

list_repos

List all accessible ShadowGit repositories to discover which ones you can analyze.

Instructions

List all available ShadowGit repositories. Use this first to discover which repositories you can work with.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The ListReposHandler class with the handle() method that executes the list_repos tool logic. It fetches repositories from RepositoryManager and formats them with workflow instructions.
    /**
     * Handler for list_repos tool
     */
    
    import { RepositoryManager } from '../core/repository-manager';
    import { createTextResponse, formatRepositoryList } from '../utils/response-utils';
    import type { MCPToolResponse } from '../types';
    
    export class ListReposHandler {
      constructor(private repositoryManager: RepositoryManager) {}
    
      /**
       * Handle list_repos tool execution
       */
      async handle(): Promise<MCPToolResponse> {
        const repos = this.repositoryManager.getRepositories();
        
        if (repos.length === 0) {
          return createTextResponse(
            `No repositories found in ShadowGit.
    
    To add repositories:
    1. Open the ShadowGit application
    2. Click "Add Repository" 
    3. Select the repository you want to track
    
    ShadowGit will automatically create shadow repositories (.shadowgit.git) to track changes.`
          );
        }
        
        const repoList = formatRepositoryList(repos);
        const firstRepo = repos[0].name;
        
        return createTextResponse(
          `🚀 **ShadowGit MCP Server Connected**
    ${'='.repeat(50)}
    
    📁 **Available Repositories (${repos.length})**
    ${repoList}
    
    ${'='.repeat(50)}
    ⚠️ **CRITICAL: Required Workflow for ALL Changes**
    ${'='.repeat(50)}
    
    **You MUST follow this 4-step workflow:**
    
    1️⃣ **START SESSION** (before ANY edits)
       \`start_session({repo: "${firstRepo}", description: "your task"})\`
    
    2️⃣ **MAKE YOUR CHANGES**
       Edit code, fix bugs, add features
    
    3️⃣ **CREATE CHECKPOINT** (after changes complete)
       \`checkpoint({repo: "${firstRepo}", title: "Clear commit message"})\`
    
    4️⃣ **END SESSION** (to resume auto-commits)
       \`end_session({sessionId: "...", commitHash: "..."})\`
    
    ${'='.repeat(50)}
    
    💡 **Quick Start Examples:**
    \`\`\`javascript
    // Check recent history
    git_command({repo: "${firstRepo}", command: "log -5"})
    
    // Start your work session
    start_session({repo: "${firstRepo}", description: "Fixing authentication bug"})
    \`\`\`
    
    📖 **NEXT STEP:** Call \`start_session()\` before making any changes!`
        );
      }
    }
  • Tool registration: name 'list_repos' is declared in the ListToolsRequestSchema handler with its description and empty inputSchema.
    private setupHandlers(): void {
      // List available tools
      this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
        tools: [
          {
            name: 'list_repos',
            description: 'List all available ShadowGit repositories. Use this first to discover which repositories you can work with.',
            inputSchema: {
              type: 'object',
              properties: {},
            },
          },
  • Tool dispatch: the CallToolRequestSchema switch-case routes 'list_repos' to listReposHandler.handle().
    switch (name) {
      case 'list_repos':
        return await this.listReposHandler.handle();
  • The formatRepositoryList() helper used by the handler to format repository names and paths for display.
    export function formatRepositoryList(repos: Array<{ name: string; path: string }>): string {
      if (repos.length === 0) {
        return 'No repositories available.';
      }
      return repos.map(r => `  ${r.name}:\n    Path: ${r.path}`).join('\n\n');
    }
  • The getRepositories() method on RepositoryManager that provides the list of repositories displayed by list_repos.
    getRepositories(): Repository[] {
      return this.repositories;
    }
Behavior2/5

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

No annotations are provided. The description does not disclose traits like read-only or side effects, relying solely on implication. This is insufficient for full transparency.

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?

Two clear, front-loaded sentences with no wasted words. Every part adds value.

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

Completeness5/5

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

Given no parameters, no output schema, and a simple purpose, the description is complete and sufficient for the agent to use the tool correctly.

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 zero parameters and 100% schema description coverage, the baseline is 4. No additional parameter info is needed.

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 tool lists all available ShadowGit repositories and is for initial discovery, distinguishing it from sibling tools that involve sessions and commands.

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

Usage Guidelines4/5

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

The description explicitly advises using this tool first for discovery, providing clear context. It does not list exclusions but the guidance is sufficient for a list tool.

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/aflsolutions/shadowgit-mcp'

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