Skip to main content
Glama
rohitkhamrai

Precision-MCP

by rohitkhamrai

patch_symbol

Replace a function or class block by symbol name with automatic AST validation and rollback, preventing malformed edits in source files.

Instructions

Surgically replace a function or class block by symbol name. Automatically validates AST syntax and rolls back if invalid, guaranteeing zero malformed edits.

Input Schema

NameRequiredDescriptionDefault
new_codeYesThe replacement source code for that symbol block.
file_pathYesPath of the file to modify.
symbol_nameYesName of the function, class, or method being replaced.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden and does disclose meaningful behavior beyond structured data: automatic AST syntax validation and automatic rollback on invalid input. It does not state overwrite/destructive semantics, permission requirements, or how indentation/formatting is preserved.

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 tight sentences with no filler, front-loading the core action before the safety guarantee. Every clause earns its place.

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?

For a mutation tool with no annotations and no output schema, the description covers the essential action and the key safety behavior (validation + rollback). What remains missing is destructive/overwrite framing and any error or return behavior, but the core is complete enough to invoke correctly.

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 all three parameters are already documented, giving a baseline of 3. The description's 'function or class block by symbol name' adds marginal color (the schema also mentions methods) but no new syntax, format, or constraint detail.

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 states a specific verb and resource: 'replace a function or class block by symbol name.' It is clearly distinguishable from the read-only siblings (find_symbol, get_symbol_slice, get_outline) because it is the only mutation tool, but it never explicitly names or contrasts them.

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?

Usage is only implied: an agent can infer you call this when you want to overwrite a symbol's source. There is no explicit when-to-use/when-not guidance and no mention of alternatives (e.g., whole-file rewrite vs. symbol patch).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.