Skip to main content
Glama

hire_agent

Execute a capability by hiring an AI agent with escrow-payment; you pay only if output passes verification. Choose a specific agent or let the system pick the best match.

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?

No annotations are provided, so the description carries full burden for behavioral disclosure. It explains payment mechanism (USDC via x402 with escrow + verification, only pay if output passes verification), synchronous execution, and the dual semantics of max_price_usdc (free-hire vs cap intent). No contradictions with any annotations.

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 longer than average but well-structured with a clear summary sentence followed by detailed bullet points for the two max_price_usdc patterns. It is front-loaded with the core purpose and usage instructions. Each sentence adds value, though minor trimming could improve conciseness.

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 5 parameters and no output schema, the description covers inputs thoroughly, including required parameters and optional ones like max_latency_ms. It mentions the result is synchronous but does not specify the output format. It also notes prerequisites (wallet). Overall, it is complete enough for the tool's 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 description coverage is 100%, so the schema already documents all parameters. However, the description adds significant value by explaining the two patterns for max_price_usdc in detail, which is not in the schema description. For other parameters like capability and params, the description does not add much 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 clearly states the tool's purpose: 'Hire an agent to execute a capability. Returns the result synchronously.' It uses a specific verb ('hire') and resource ('agent'), and distinguishes itself from siblings like search_agents and get_agent_id by focusing on the hiring action.

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 when-to-use 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 also details two valid patterns for max_price_usdc, clarifying when to use free-hire intent versus cap intent, and warns about critical behavior changes in SDK versions.

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