Skip to main content
Glama

fix_code

Diagnose and fix bugs in code using error messages or symptoms. Provide code or file path for automated correction.

Instructions

Diagnose and fix a bug in code, given an optional error message or symptom.

Provide exactly one of code or file_path. Include error_message (a stack trace, test failure, or description of wrong behavior) whenever you have one -- it substantially improves fix quality.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNo
thinkNo
file_pathNo
error_messageNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

No annotations exist, so the description must disclose behavior. It implies fixing a bug (mutation) but does not specify whether the tool modifies the original code, returns a diff, or requires permissions. The output schema exists but is unused in the description.

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 short, focused sentences with no redundant information. The first states purpose, the second gives constraints and tips.

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

Completeness3/5

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

For a tool with 4 parameters and no annotations, the description covers parameter usage but lacks information on return format, side effects, and behavioral details. An output schema exists but is not leveraged.

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?

The description explains the mutual exclusivity of 'code' and 'file_path' and the value of 'error_message', adding meaning to the 0% schema coverage for parameters. However, 'think' is not described.

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 verb 'Diagnose and fix a bug' and the resource 'code', distinguishing it from sibling tools like generate_code (creation) or explain_code (explanation).

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?

It explicitly states to provide exactly one of 'code' or 'file_path' and to include 'error_message' when available, giving clear usage guidance. However, it does not directly compare with sibling tools.

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/darthzen/ollama-code-mcp'

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