Skip to main content
Glama

buggy_investigate

Prove a Python function defect by executing generated inputs and return a reproducible failing-call certificate; use before editing risky code and after fixes to verify the fix holds.

Instructions

Prove whether a Python function has a defect, by executing it on generated inputs. Returns a certificate naming the exact failing call, verified three ways: the input satisfied the preconditions, the failure was re-observed in a fresh process, and it recurred on repeat attempts. A proven finding is reproducible by hand. 'unconfirmed' means no failing input was found within the budget and is NOT a proof of safety. Use this before editing a risky function, and after editing one to check the fix held.

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": {
      "function": "<function>",
      "file": "<file>"
    },
    "name": "buggy_investigate"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesPath to the Python file, absolute or relative to cwd.
budgetNoInputs to execute before giving up. Default 300.
recordNoStore a proven defect in .buggy/ so it can be re-run later with buggy_recheck. Default false; a tool inspecting code should not write files uninvited.
timeoutNoSeconds allowed per call. Default 2.
functionYesFunction name. Use a dotted name for a class member, e.g. 'Cart.total'.
receiverNoExpression building the object an instance method is called on, e.g. 'Cart([1, 2])'. Inferred from __init__ when omitted.
preconditionsNoPreconditions as PYTHON expressions over the parameter names, e.g. 'budget > 0'. For an instance method the constructor's parameters are in scope too. Inputs that fail these are skipped, so they also decide which inputs a fix is allowed to change.
postconditionsNoPostconditions as PYTHON expressions. 'result' is the return value, e.g. 'result >= 0'. A condition that cannot be evaluated is reported as a warning, never silently skipped.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so well: it discloses the certificate-returning behavior, the three independent verification steps, fresh-process re-observation, repeat-attempt recurrence, the meaning of 'unconfirmed', and the fact that record defaults to false because a code-inspecting tool should not write files uninvited.

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 front-loaded with the core purpose, then verification semantics, then the important 'unconfirmed' caveat, then usage timing. Every sentence earns its place with no filler or repetition.

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 an 8-parameter execution tool with no output schema and no annotations, the definition is thorough on purpose, verification semantics, caveats, and usage timing. It is slightly incomplete about environment prerequisites and the detailed structure of the returned certificate, but overall it gives enough for correct invocation.

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?

Schema description coverage is already 100%, so the baseline is 3, but the description adds real meaning: preconditions determine which inputs are skipped and also constrain what a fix may change, postcondition evaluation failures are warned rather than silently skipped, and the record default is explained. It does not add much for file, function, budget, timeout, or receiver beyond the schema.

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 states a specific verb and resource: proving whether a Python function has a defect by executing it on generated inputs. It clearly distinguishes this execution-based proof from adjacent tools like buggy_scan or buggy_functions by emphasizing generated inputs, certificates, and three-way verification.

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 gives explicit timing guidance: use before editing a risky function and after editing to verify the fix held. It does not name alternative sibling tools or explicitly state when not to use this tool, so it falls short of full competing-alternative guidance.

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