Skip to main content
Glama

Refund a job

refund_job
DestructiveIdempotent

Refund one job's payment to its sender, or issue an account credit.

Destructive and irreversible: funds go back on Base and the job is marked refunded. No undo.

Behavior: refunds on-chain when a private key is configured, else credits the sender. Returns a refund hash, 'credit_only', or 'job_not_found'. Refunding twice is safe.

Parameters: an unknown key returns job_not_found and moves nothing.

When to use: when a paid job failed. Check get_job_status first; use get_credit_balance to see if a refund became credit.

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": {
      "job_key": "<job_key>"
    },
    "name": "refund_job"
  }
}

Input Schema

NameRequiredDescriptionDefault
job_keyYesJob key to refund, from execute_task or list_jobs. Required.

Output Schema

NameRequiredDescriptionDefault
errorNo
resultYesrefund tx hash, 'credit_only', or 'job_not_found'
job_keyNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true, idempotentHint=true, and readOnlyHint=false, yet the description still adds material context: funds move on Base, the job is marked refunded, there is no undo, and on-chain vs. credit behavior depends on whether a private key is configured. It also anticipates the ambiguous case ("Refunding twice is safe") and the invalid-key case, which is exactly the behavior an agent needs before committing to a mutation.

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?

Front-loads the action and the destructive warning, then uses short labeled sections (Behavior, Parameters, When to use) that map to the questions an agent asks in order. Wording is tight; the only repetition is "irreversible" and "No undo," which reads as deliberate emphasis on the highest-risk fact.

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 one-parameter, high-stakes mutation, the description covers activation conditions, side effects, irreversibility, idempotency, failure semantics, and follow-up tools. An output schema exists, so the brief mention of return values (refund hash, 'credit_only', 'job_not_found') is more than enough.

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?

With one parameter at 100% schema coverage, the schema already explains what job_key is and where to get it, so the baseline is 3. The description adds meaning the schema does not: an unknown key returns job_not_found and moves nothing, which tells the agent the parameter is validated before any funds move.

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?

Opens with a specific verb and resource plus its two possible outcomes: "Refund one job's payment to its sender, or issue an account credit." That scope distinguishes it clearly from siblings like get_credit_balance and cancel_job without the agent needing to open a 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?

Provides an explicit trigger ("when a paid job failed"), a prerequisite ("Check `get_job_status` first"), and a follow-up route ("use `get_credit_balance` to see if a refund became credit"). An agent has a complete decision path in and out of this tool.

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.

Resources