Skip to main content
Glama

link_commits_to_sessions

Connect git commits to writing sessions to track manuscript changes and provide context for project development.

Instructions

Link git commits to writing sessions for context

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathNoPath to manuscript directory (defaults to current directory)
sinceNoStart date (ISO format or relative)
limitNoMaximum commits to process

Implementation Reference

  • Core handler implementation: indexes git commits since optional date and links them to writing sessions via GitIntegrator
    async linkCommitsToSessions(options?: { since?: string; limit?: number }) {
      const since = options?.since ? new Date(options.since) : undefined;
      const result = await this.gitIntegrator.indexCommits({
        since,
        filePattern: "**/*.md",
      });
    
      // Auto-link commits to sessions based on timestamp proximity
      // (Future enhancement: use conversation files for precise linking)
    
      return {
        commitsIndexed: result.commitsIndexed,
        revisionsCreated: result.revisionsCreated,
        message: "Git commits indexed successfully",
      };
    }
  • MCP tool handler wrapper: extracts 'since' and 'limit' parameters from args and delegates to WritersAid implementation
    private async linkCommitsToSessions(args: Record<string, unknown>) {
      const since = args.since as string | undefined;
      const limit = (args.limit as number) || 20;
    
      return this.writersAid.linkCommitsToSessions({ since, limit });
    }
  • Tool registration in the main handleTool switch statement
    case "link_commits_to_sessions":
      return this.linkCommitsToSessions(args);
  • MCP tool schema definition including input parameters and description
    {
      name: "link_commits_to_sessions",
      description: "Link git commits to writing sessions for context",
      inputSchema: {
        type: "object",
        properties: {
          project_path: { type: "string", description: "Path to manuscript directory (defaults to current directory)" },
          since: { type: "string", description: "Start date (ISO format or relative)" },
          limit: { type: "number", description: "Maximum commits to process", default: 20 },
        },
      },
    },
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. It mentions linking commits to sessions 'for context' but doesn't explain what this linking entails (e.g., does it create associations, update databases, or just analyze?), what permissions are needed, whether it's read-only or mutative, or what output to expect. This leaves significant gaps for a tool that likely involves data processing.

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 that gets straight to the point with no wasted words. It's appropriately sized for the tool's apparent complexity and is front-loaded with the core action, making it easy to parse quickly.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain the behavioral aspects (e.g., what 'linking' means operationally, whether it's safe or destructive), the expected output format, or how it integrates with sibling tools. For a tool with three parameters and no structured safety hints, this leaves too much unspecified for reliable agent use.

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 three parameters thoroughly. The description adds no additional meaning about the parameters beyond what's in the schema, such as how 'since' and 'limit' affect the linking process. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but doesn't detract either.

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 clearly states the verb 'link' and the resources 'git commits' and 'writing sessions', providing a specific purpose. However, it doesn't distinguish this tool from sibling tools like 'track_changes' or 'track_concept_evolution' that might also involve commit analysis, missing explicit differentiation.

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. With sibling tools like 'track_changes' and 'track_concept_evolution' that might overlap in analyzing commits, there's no indication of when this linking operation is preferred or what specific context it serves beyond the vague 'for context'.

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/xiaolai/claude-writers-aid-mcp'

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