Skip to main content
Glama

generate-code

Generate a self-contained Python function that passes its asserts [x402: 0.02 USDC on Base, pay-per-use]

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": {
      "input": "<input>"
    },
    "name": "generate-code"
  }
}

Input Schema

NameRequiredDescriptionDefault
inputYesa description of ONE Python function (name, arguments and behavior)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It does add genuinely useful behavior: the tool is paid (0.02 USDC on Base, per use), so cost awareness is disclosed, and output is self-contained and assert-passing. However, it says nothing about failure behavior, whether tests must be supplied in the input, rate limits, or the return format beyond 'a function'.

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?

One front-loaded sentence plus a bracketed pricing tag, with zero filler. The brevity is largely a virtue here, though the pricing tag is appended rather than integrated into the purpose statement.

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?

No output schema and no annotations, so the description is the only source of truth, and it leaves open what comes back (a code string? file?), what happens when asserts can't be satisfied, and whether the caller must include tests in 'input'. Adequate to attempt a call, not adequate to predict the result.

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 coverage is 100% and there is a single parameter, so the schema already explains 'input' fully. The description adds only the framing that the function must be self-contained and assert-passing, which mildly shapes what the input should contain, but it never reconciles this with the schema's 'name, arguments and behavior' wording — asserts are not mentioned there.

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?

States a specific verb+resource: 'Generate a self-contained Python function', with an added qualifier that the function must 'pass its asserts'. This tells an agent the output is verified code, not just a snippet. It stops short of distinguishing itself from the sibling 'code-gen', which an agent would have to disambiguate on its own.

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 when-to-use or when-not guidance, and no named alternative. Given a sibling named 'code-gen' appears in the catalog, the absence of any routing cue is a real gap. The only implicit signal is the Python/asserts framing.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.