Skip to main content
Glama

codna_fix

Find and fix bugs by analyzing repository state, determining root cause and confidence, and optionally opening a pull request.

Instructions

Find and fix a bug. Runs the full Codna agent + engine + risk simulation.

Requires the one-time free codna login device authorization (free community license) plus a provider key (BYOK — e.g. ANTHROPIC_API_KEY or codna key set anthropic). Offline truth: planning calls the provider API (network), and only open_pr=true writes to GitHub — codna_triage, codna_secure and codna_recall are the fully-offline tools.

Returns the root cause, confidence, model, and (when open_pr) the pull_request_url. Failures come back as 'codna_fix error: ...' text — the tool never raises.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoBranch, tag, or commit to analyze: the planner's repository snapshot is taken at this ref (registration forwards it to create_repository_snapshot). Default '': the repo's current state — the checkout as-is for a local path, the default branch for a git URL.
repoNoA local path or a git URL. open_pr=true requires a git URL (a local checkout has no remote to push to). Default '.': the current directory, or the server default set by `codna mcp start --repo` (env CODNA_MCP_DEFAULT_REPO)..
issueNoWhat's broken — e.g. the failing test or the observed behavior. Required when open_pr=true; otherwise optional but strongly recommended (an empty issue yields a generic repo-wide plan).
modelNoProvider-qualified planner model, e.g. openai/gpt-5. Default 'repository.verified_agentic_v1' (codna's verified agentic runtime).repository.verified_agentic_v1
open_prNofalse (default): READ-ONLY plan — returns root cause, confidence and a patch reference, and changes nothing. true: pushes a fix branch and OPENS A PULL REQUEST — needs a git URL for repo and GITHUB_TOKEN (or CODNA_GITHUB_TOKEN) with write access; returns pull_request_url.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.1.6
    • addedInput schema / properties / issue / description
      Added value: +"What's broken — e.g. the failing test or the observed behavior. Required when open_pr=true; otherwise optional but strongly recommended (an empty issue yields a generic repo-wide plan)."
    • addedInput schema / properties / model / description
      Added value: +"Provider-qualified planner model, e.g. openai/gpt-5. Default 'repository.verified_agentic_v1' (codna's verified agentic runtime)."
    • addedInput schema / properties / open_pr / description
      Added value: +"false (default): READ-ONLY plan — returns root cause, confidence and a patch reference, and changes nothing. true: pushes a fix branch and OPENS A PULL REQUEST — needs a git URL for repo and GITHUB_TOKEN (or CODNA_GITHUB_TOKEN) with write access; returns pull_request_url."
    • addedInput schema / properties / ref / description
      Added value: +"Branch, tag, or commit to analyze: the planner's repository snapshot is taken at this ref (registration forwards it to create_repository_snapshot). Default '': the repo's current state — the checkout as-is for a local path, the default branch for a git URL."
    • addedInput schema / properties / repo / description
      Added value: +"A local path or a git URL. open_pr=true requires a git URL (a local checkout has no remote to push to). Default '.': the current directory, or the server default set by `codna mcp start --repo` (env CODNA_MCP_DEFAULT_REPO)."
  2. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations, the description discloses network dependence, GitHub write behavior conditional on open_pr, the return payload (root cause, confidence, model, pull_request_url), and the failure contract ('codna_fix error: ...' text, tool never raises). This is substantially more behavioral context than the annotations alone provide, and it does not contradict any annotation.

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 dense but well structured: purpose first, then prerequisites/offline truth, then return values and failure behavior. Every sentence carries operational weight, and the most important constraints (network, writes, failure mode) are front-loaded.

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

Completeness5/5

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

For a complex tool with auth requirements, network calls, conditional GitHub writes, offline sibling alternatives, an output schema, and special failure behavior, the description covers all key non-schema context. The output schema handles return details, so nothing critical is missing for an agent to invoke this tool 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%, and each parameter already has detailed descriptions covering defaults, required conditions, and side effects. The description adds general context like auth and output shape but not new per-parameter semantics, so the baseline score of 3 is appropriate.

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 opens with a specific verb and resource ('Find and fix a bug') and immediately clarifies the full scope: running the Codna agent, engine, and risk simulation. It also distinguishes itself from fully-offline siblings by naming codna_triage, codna_secure, and codna_recall as offline alternatives, so an agent can separate fix behavior from triage/recall/secure.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit usage context: it requires codna login and a provider key, explains that planning needs network access, and states that only open_pr=true writes to GitHub. It also points to the fully-offline sibling tools as alternatives when offline behavior is required, which is clear when-to-use vs when-not-to-use guidance.

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