Skip to main content
Glama

generate-fix

Creates a suggested code fix for a specific Solana/Anchor security finding at a given line using the provided source code and pattern ID.

Instructions

Generate a code fix suggestion for a specific finding at a given line.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "source_code": "<source_code>",
      "pattern_id": "<pattern_id>",
      "line_number": "<line_number>"
    },
    "name": "generate-fix"
  }
}

Input Schema

NameRequiredDescriptionDefault
pattern_idYesPattern ID to fix (e.g., SOL-C-001)
line_numberYesLine number where the finding was detected
source_codeYesFull source code

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full disclosure burden. The word 'suggestion' weakly implies nothing is applied to the codebase, but the definition never confirms this is non-mutating, never mentions permissions or prerequisites, and never indicates the form of the result (diff, snippet, or prose).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no filler or redundancy. It is efficient, though its brevity is achieved by omitting content rather than by tight editing of rich content.

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?

For a three-required-parameter generation tool with no annotations and no output schema, the description leaves too much open: what the returned fix looks like, whether it is safe to call repeatedly, and whether the source_code must match the code the finding came from. The schema covers the inputs, but the behavioral and output shape remain unspecified.

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 with examples (e.g., 'SOL-C-001'). The description adds only the framing that the pattern and line together identify 'a specific finding', which is marginal but consistent with the schema; baseline 3 applies.

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 gives a specific verb and resource ('Generate a code fix suggestion') scoped to 'a specific finding at a given line', which is enough to distinguish it from audit-style siblings. It stops short of naming or contrasting with the closest sibling, explain-finding, so the differentiation is inferred rather than stated.

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?

There is no guidance on when to call this versus explain-finding or the audit tools, and no stated precondition that a finding must first be identified. The agent must guess the workflow position of this tool from its name alone.

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