Skip to main content
Glama

treasury_sweep

Collect forfeited worker collateral or dispute fees from refunded or voided contracts and transfer them to the protocol treasury. Only callable by the treasury key wallet.

Instructions

Sweep forfeited funds to the protocol treasury.

Only succeeds if this wallet holds the treasury key (the wallet that deployed the contract). Collects exactly two kinds of forfeited funds: the worker's collateral from a Refunded contract that went through the Active path (worker committed, never delivered), or the dispute fee from a Voided contract. Each can be swept once. The call fails for any other wallet or any other contract state.

Args: job_id: The Refunded or Voided contract ID to sweep.

Returns confirmation of the sweep, or error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
job_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses key behavior: treasury-key ownership requirement, the two eligible fund types, the one-time sweep limit, and failure for any other wallet/state. It does not explicitly mention the impact on contract state but covers the main constraints effectively.

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 well-structured with a lead sentence, then paragraphs for conditions, args, and returns. Every sentence adds necessary context, with no fluff or repetition.

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?

Given the single-param schema, absent annotations, and presence of an output schema, the description covers the purpose, eligibility, failure conditions, parameter meaning, and return type (confirmation or error). It is complete for the tool's moderate complexity.

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%, so the description compensates by explaining job_id as 'The Refunded or Voided contract ID to sweep', adding the constraint that it must be a specific contract type beyond the bare integer type in 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 clearly states the action: 'Sweep forfeited funds to the protocol treasury.' It specifies the resource (protocol treasury), the exact kinds of funds (worker's collateral from Refunded contracts, dispute fee from Voided contracts), and distinguishes from sibling tools like claim_funds or refund_contract by the treasury context.

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?

Provides explicit conditions for use: only succeeds for the treasury key holder, only for specific contract states (Refunded active path, Voided), each can be swept once, and fails for any other wallet or state. This is near-explicit when-not, though it does not name alternative tools for other scenarios.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/honeytones/idios'

If you have feedback or need assistance with the MCP directory API, please join our Discord server