Skip to main content
Glama
mdz-axo

PT-MCP (Paul Test Man Context Protocol)

by mdz-axo

update_context

Update context files incrementally by analyzing code changes to maintain accurate project documentation and semantic understanding.

Instructions

Incrementally update existing context files based on code changes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesRoot directory path
changed_filesYesList of changed file paths
context_formatYesContext format to update
force_full_regenerationNoForce complete regeneration instead of incremental update

Implementation Reference

  • The main handler function implementing the update_context tool logic. Currently a placeholder that returns a JSON message indicating pending implementation.
    export async function updateContext(
      args: UpdateContextArgs
    ): Promise<{ content: Array<{ type: string; text: string }> }> {
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              {
                message: "Context update - implementation pending",
                changed_files: args.changed_files.length,
              },
              null,
              2
            ),
          },
        ],
      };
    }
  • TypeScript interface defining the input parameters for the updateContext handler function.
    interface UpdateContextArgs {
      path: string;
      changed_files: string[];
      context_format: string;
      force_full_regeneration?: boolean;
    }
  • Dispatch case in the CallToolRequestSchema handler that routes 'update_context' calls to the updateContext function.
    case "update_context":
      return await updateContext(args as any);
  • JSON Schema definition and metadata for the update_context tool, provided in the ListTools response.
    {
      name: "update_context",
      description: "Incrementally update existing context files based on code changes",
      inputSchema: {
        type: "object",
        properties: {
          path: {
            type: "string",
            description: "Root directory path",
          },
          changed_files: {
            type: "array",
            items: { type: "string" },
            description: "List of changed file paths",
          },
          context_format: {
            type: "string",
            enum: ["cursorrules", "cursor_dir", "spec_md", "agents_md"],
            description: "Context format to update",
          },
          force_full_regeneration: {
            type: "boolean",
            description: "Force complete regeneration instead of incremental update",
            default: false,
          },
        },
        required: ["path", "changed_files", "context_format"],
      },
    },
  • src/tools/index.ts:9-9 (registration)
    Import statement bringing the updateContext handler into the tools dispatcher module.
    import { updateContext } from "./update-context.js";
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool performs 'incremental updates' and mentions 'code changes,' but doesn't describe what 'context files' are, how updates are applied (e.g., merging, overwriting), potential side effects, or performance considerations. For a mutation tool with zero annotation coverage, this leaves significant behavioral gaps.

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 front-loads the core action ('incrementally update') and key constraints ('existing context files,' 'based on code changes'). There is no wasted verbiage or redundant information, making it highly scannable and focused.

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 (mutation with 4 parameters, no annotations, no output schema), the description is insufficient. It doesn't explain what 'context files' are, the impact of updates, error handling, or output format. While schema coverage is high, the description fails to compensate for the lack of behavioral context, making it incomplete for safe and effective 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 fully documents all parameters. The description adds no additional parameter semantics beyond what's in the schema—it doesn't explain relationships between parameters (e.g., how 'changed_files' interacts with 'context_format') or provide examples. This meets the baseline for high schema coverage but doesn't enhance understanding.

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 action ('incrementally update') and target ('existing context files'), with the qualifier 'based on code changes' providing additional specificity. It distinguishes from siblings like 'generate_context' (likely creates new) and 'enrich_context' (likely adds content rather than updates based on changes). However, it doesn't explicitly contrast with all siblings like 'validate_context' or 'watch_project'.

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 incremental updates are appropriate versus full regeneration (hinted at by the 'force_full_regeneration' parameter), nor does it differentiate from siblings like 'enrich_context' or 'generate_context' in terms of use cases. The agent must infer usage from the tool name and parameters alone.

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/mdz-axo/pt-mcp'

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