Skip to main content
Glama

check_code

Execute a self-contained Python snippet and confirm its stdout matches the expected output, returning refuted if the code errors or prints something different.

Instructions

Run a self-contained Python snippet and confirm its stdout contains expected_output.

WARNING: this executes the code. Only pass code you would run yourself; it is not sandboxed from the network or filesystem. Returns refuted if the snippet errors or prints something other than claimed.

Input Schema

NameRequiredDescriptionDefault
snippetYes
expected_outputYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/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: it warns that the code is actually executed, that it is not sandboxed from the network or filesystem, and it defines the failure semantics ('returns refuted if the snippet errors or prints something other than claimed'). These are the exact behavioral traits an agent needs before invoking an execution tool.

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?

Three tight sentences, front-loaded with the primary action, then the safety warning, then the return contract. No filler; each sentence adds information an agent would otherwise have to guess.

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?

No output schema exists, and the description covers the most important return case (refuted on error or mismatched output), which is enough to call the tool correctly. It does not state what a successful result looks like or whether it echoes the actual stdout, a small gap for a verification tool.

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 coverage is 0% (no parameter descriptions at all), so the description must compensate, and it largely does: 'self-contained Python snippet' scopes the snippet, and 'confirm its stdout contains expected_output' establishes that expected_output is a substring-containment match rather than an exact-match string. A few details (encoding, trailing newline handling) remain unspecified.

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?

States a specific operation (run a self-contained Python snippet), the verification contract (confirm stdout contains expected_output), and does so in terms that clearly separate it from check_quote, check_citation, check_repo, and check_math. An agent can select it without opening the schema.

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 guidance is implicit: 'self-contained Python snippet' and 'Only pass code you would run yourself' define the context of appropriate use, but there is no explicit statement of when to prefer this over a sibling (e.g. check_math for pure arithmetic) or when not to use it. Adequate but leaves selection against alternatives to inference.

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