Skip to main content
Glama

Invoke agent

invoke_agent

Send a message to a persistent agent and get its reply for tasks that outlive a single request—files, installed software, or long jobs. Use it for durable work, not one-off stateless snippets.

Instructions

Send a message to an agent and get its reply. Use this for work that should outlive a single request: files written now and read next week, software installed once and reused, a repo kept checked out, or a long job handed off and read later. Do not use it for a stateless snippet you can run inline, with no state worth keeping: a plain code sandbox is cheaper and faster for that. By default waits up to ~25s for the turn to finish and returns the assistant's reply; if it is still running by then it returns a run_id with status "running" to poll via get_run_result. Agent turns can take minutes (research, multi-step or tool-heavy work). This call blocks your own turn while it waits, and no MCP client backgrounds it — so if the user is not waiting on this reply, or you expect a long turn, pass wait=false to get a run_id back immediately and poll get_run_result on your own cadence instead of holding the call open. Running an agent spends credits, and an account's plan caps how many runs it may have in flight at once across all its agents (over the cap returns 429; wait for a run to finish and retry). Turns on one agent are not queued for you. Pass idempotency_key when you might retry this call: a retry carrying the same key returns the original run instead of starting and billing a second one. If the run pauses on a human-input request it returns status "awaiting_input" with the pending request details inline (respond with answer_pending_input). Every result also carries a "url" that opens this run's exact session in the web app, so a human can go read it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
waitNoWait (up to ~25s) for the turn and return the reply (default true). Set false to return a run_id immediately and poll get_run_result — prefer this for long or tool-heavy turns so the call doesn't block your own turn.
messageYesThe message to send to the agent.
agent_idYesThe agent's UUID.
session_idNoOptional thread/session id to continue an existing conversation (a previous invoke_agent or get_run_result result carries it as "session_id"); omit to start a new one.
idempotency_keyNoOptional retry guard: a string you generate for this attempt. Re-sending the same key with the same agent and message within 24h returns the ORIGINAL run instead of starting a second one. Reusing a key with a different message is an error.
max_turn_tokensNoOptional cumulative cache-weighted token ceiling for this turn (0 or omitted uses forge's default; maximum 5,000,000). The agent reserves its final 2% for a tool-free wrap-up.
max_turn_secondsNoOptional soft wall-clock budget for this turn in seconds (0 or omitted uses forge's deployment default; maximum 14,400). It schedules an in-loop checkpoint and does not cancel the run.
Install Server

TDQS

A4.9/5.0
Behavior5/5

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

Beyond annotations (openWorldHint=true, destructiveHint=false), the description discloses many behavioral traits: it blocks the caller's turn, waits up to ~25s, may return a running status with run_id, bills credits, enforces in-flight caps (429), does not queue turns, handles human-input pauses with awaiting_input, and returns a session URL. There is no contradiction with annotations.

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?

Though long, every sentence earns its place. The description front-loads the purpose and then systematically covers usage rules, blocking behavior, billing, retries, human input, and result contents. No redundancy or filler; the density is justified by the tool's complexity.

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?

No output schema exists, so the description carries full responsibility for return values—it explains the reply, run_id with status 'running', awaiting_input details, and a URL. It also covers error conditions (429), side effects (credits, billing), and integration with sibling tools (poll via get_run_result, respond via answer_pending_input). For a tool with 7 params and complex async behavior, this is complete.

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?

The schema has 100% coverage for all 7 parameters, so the baseline is 3. The description adds meaningful context for wait (explains blocking and no backgrounding, when to switch to wait=false), idempotency_key (retry scenario and billing avoidance), and session_id (carried from previous results). This extra guidance raises the score above baseline.

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 opens with a specific verb+resource: 'Send a message to an agent and get its reply,' which clearly defines the tool's core purpose. It also distinguishes from sibling tools by explicitly mentioning get_run_result and answer_pending_input as related operations, and contrasts invoke_agent with 'a plain code sandbox' for stateless work.

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 explicit when-to-use guidance ('work that should outlive a single request'), when-not-to-use ('stateless snippet... plain code sandbox is cheaper'), and when to set wait=false for long turns. Also explains when to use idempotency_key for retries and references get_run_result and answer_pending_input for follow-up, giving clear alternatives.

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

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/plori-ai/plori'

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