Skip to main content
Glama
@three-ws/ibm-x402-mcp

@three-ws/ibm-x402-mcp

by nirholas

IBM Granite Code ($0.025)

ibm_granite_code
Read-only

Generate, review, refactor, explain, test, or document source code using IBM Granite instruct models, with USDC pay-per-call access and no IBM Cloud account.

Instructions

Code generation, review, refactoring, and explanation via IBM Granite instruct models. Provide a task type and code/prompt; receive the generated or reviewed code with explanation. Use this when the input is source code or a request to write code; for general conversation call ibm_granite_chat instead. No IBM Cloud account required — pay $0.025 USDC per call via x402.

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": {
      "task": "<task>",
      "prompt": "<prompt>"
    },
    "name": "ibm_granite_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
taskYesCode task: generate (new code from description), review (bugs/security), refactor (quality), explain (plain language), test (unit tests), or document (add docstrings).
promptYesFor "generate": describe what to build. For all others: paste the code to process.
contextNoAdditional context: architecture notes, constraints, or example usage.
languageNoTarget programming language (e.g. "TypeScript", "Python", "Rust"). Optional for explain/review.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.1.4
    • removedInput schema / additionalProperties
      Removed value: -false
  2. First observedv1.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, openWorldHint, idempotentHint=false and destructiveHint=false, so the description's added value is the payment model: no IBM Cloud account needed, $0.025 USDC per call via x402. It also states the shape of the result (generated or reviewed code with explanation), which the absent output schema would otherwise leave ambiguous; it does not cover latency, rate limits, or failure modes.

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 sentences: capability first, routing rule second, pricing/access third. Every sentence carries distinct information and nothing repeats the schema or title.

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?

With no output schema, the description correctly describes the return (code plus explanation), and it covers access/payment prerequisites that are otherwise invisible. For a four-parameter tool with full schema coverage this is nearly complete; only input length limits and expected behavior on invalid code for review are left to the schema or unstated.

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%, including per-enum meanings for task and a prompt description that distinguishes generate from the other task types, so the schema already does the heavy lifting. The description only restates the required inputs at a high level ("provide a task type and code/prompt") and adds no format or syntactic detail 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 names specific verbs (generation, review, refactoring, explanation) tied to a concrete resource (code) and identifies the underlying model family (IBM Granite instruct). It also names the sibling it is not for (ibm_granite_chat), so an agent can distinguish this from chat without opening either schema.

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?

It gives an explicit selection rule: use when the input is source code or a request to write code, otherwise use ibm_granite_chat for general conversation. The when-to-use, when-not-to-use, and the named alternative are all present in a single sentence.

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