Skip to main content
Glama

hire_agent

Hire an agent for a capability with escrow-secured USDC payment—pay only if output passes verification. Specify max price or get a free tier.

Instructions

Hire an agent to execute a capability. Returns the result synchronously. Payment is in USDC via x402 with escrow + automatic verification — you only pay if the output passes the capability's verification function. Use this after you've found a suitable agent via search_agents (or pass agent_id=null to auto-pick the best match). Requires a wallet.

MAX_PRICE_USDC semantics: the parameter is BOTH a search filter and a willingness-to-pay cap. Two valid patterns: (a) max_price_usdc='0' (or '0.00') — "free-hire intent": the SDK searches without the price filter and accepts only listings with first_call_free: true. Use this when get_remaining_budget returns '0.00' and you want to try a free-tier listing. (b) max_price_usdc='X.YZ' (positive) — "cap intent": the SDK filters listings priced ≤ X.YZ and proceeds with payment. The listing's actual price (which may be lower) is what gets charged. Picking pattern (a) when you intend free-tier hires is critical: passing '0.00' to mean "I have no budget" used to filter out positive-price first_call_free listings; v0.5.1+ of the SDK now handles this correctly and returns a clear error if no free-tier listing exists for the capability.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
capabilityYesThe capability ID to hire for, e.g. 'image.generate.photorealistic.png'.
paramsYesCapability-specific input parameters. Schema depends on the capability. Example for image.generate.photorealistic.png: { prompt: string, width: int, height: int, seed?: int }.
max_price_usdcYesMaximum price per call, USDC decimal string. Pass '0' (or '0.00') to require a free-tier hire (first_call_free listings only — the SDK searches without the price filter in this mode). Pass a positive value (e.g. '0.10') to set an upper-bound cap. See tool description for full semantics.
agent_idNoSpecific agent to hire (0x-prefixed address). If omitted, the SDK picks the best match by price + reputation.
max_latency_msNoMaximum acceptable latency in ms. Optional.
Behavior5/5

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

Even without annotations, the description thoroughly explains key behaviors: synchronous execution, payment in USDC via x402 with escrow and automatic verification, and the 'only pay if output passes' condition. The detailed semantics of max_price_usdc, including free-hire vs. cap intent, are transparently documented.

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?

The description is somewhat verbose but well-structured with bullet points for max_price_usdc semantics. Every sentence adds necessary detail for correct usage, though some redundancy exists (e.g., 'Use this after...' re-emphasized). It is appropriately sized for the complexity of the tool.

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?

Given no output schema and high complexity (5 params, no annotations), the description is quite complete. It covers purpose, usage, parameter semantics, and constraints (wallet required). The only minor gap is the exact format of the synchronous result, but the variability across capabilities likely justifies this omission.

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 100%, so baseline is 3. The description adds value by explaining the dual semantics of max_price_usdc with explicit patterns (free-hire vs. cap) and their implications, going beyond the schema's description. Other parameters are adequately described in the schema, so the description provides marginal extra benefit.

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 tool's purpose: 'Hire an agent to execute a capability. Returns the result synchronously.' It distinguishes itself from sibling tools like search_agents by positioning itself as the tool to use after finding an agent or to auto-pick the best match. The verb 'hire' is specific and the resource 'agent for capability' is well-defined.

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?

The description provides explicit usage guidance: 'Use this after you've found a suitable agent via search_agents (or pass agent_id=null to auto-pick the best match). Requires a wallet.' It clearly specifies prerequisites and contextual cues, effectively differentiating from the 'search_agents' sibling.

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/Swarmwage/swarmwage'

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