Skip to main content
Glama

Invoke agent

invoke_agent

Send a message to a hosted agent and receive the reply, or get a run_id to poll for long-running tasks. Handles human-in-the-loop input and returns a session URL.

Instructions

Send a message to an agent. 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. If the run pauses on a human-input request it returns status "awaiting_input" (use list_pending_inputs + 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; omit to start a new one.
Behavior5/5

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

Goes beyond annotations by detailing blocking behavior, credit consumption, timeout mechanics, status values (running, awaiting_input), and the URL in results. 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?

Every sentence adds value: purpose, default behavior, timeouts, blocking, wait=false guidance, credits, edge cases, and URL. Front-loaded and no fluff.

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?

Covers all critical aspects: return values, states, credit cost, alternative tools, blocking nature, and human input flow. No output schema but description compensates fully.

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 significant meaning for the wait parameter (usage guidance), but other parameters (agent_id, session_id) rely mostly on schema. Overall adds value beyond 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 'Send a message to an agent' and explains the default behavior and alternative outcomes, distinguishing this tool from siblings like list_runs or get_run_result.

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?

Explicitly advises when to use wait=false ('if the user is not waiting on this reply, or you expect a long turn'), references get_run_result for polling, and mentions list_pending_inputs/answer_pending_input for human input handling.

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

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