Skip to main content
Glama

agents_ask

Send a message to an AI agent and get its response.

The agent runs with its configured prompt, tools, and knowledge. Use this to test agents or have them process a task.

Returns: {status: 'replied'|'silent', response_text, messages[], full_reply, model_used, tokens_*, send_mode, execution_mode, tool_calls[]}. tool_calls[] is the per-tool trace in call order — each {tool, success, error, duration_ms} — so you can see which tool the agent ran and why it failed (e.g. a workbench script error) directly from this response, no trace lookup needed. messages[] carries each messages.send invocation the agent made (text, subject, reply_to_message_id, timestamp, message_id, attachments=[{file_id,name,mime}]). full_reply concatenates text only — attachment-only sends show up in messages but not full_reply. status='silent' iff both response_text is empty AND messages is empty.

Execution may take 10-60s depending on agent complexity. For runs that may exceed ~2 minutes (heavy multi-step agents), pass background=true: the call returns immediately with status='started' and the run continues server-side, detached from this connection — poll agents.traces_list / agents.trace_get for the outcome and agents.list_drafts for produced drafts.

Input Schema

NameRequiredDescriptionDefault
messageYesMessage/goal to send to the agent
agent_idYesID of the AI agent to ask
send_modeNoSend mode for the agent run: 'draft' = create drafts, 'auto' = send directly. Defaults to the agent's configured default_send_mode. Does NOT change execution_mode — that is fixed by the agent's config.
backgroundNoRun detached from this MCP connection. Returns immediately with status='started'; the run survives client timeouts and disconnects (up to 15 min). Poll agents.traces_list for the outcome. Use for runs expected to exceed ~2 minutes — a synchronous call is cancelled when the MCP request dies. OMIT to run synchronously and get the answer in this call (the default).
in_workspaceNoRun this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected.
reply_to_agent_idNoThe Claude Code agent whose session should receive the answer (normally your own agent, when you are a Claude Code session asking another one). A Claude Code agent answers later, not in this call (status='delegated'); with this set, its answer is delivered to your session as a new message. Without it the answer is only on the trace (agents.trace_get). Must be a Claude Code agent of this workspace, not the one asked. Ignored for other agents, which answer in this call.
attachment_file_idsNoFile ids to attach to the message, as a customer would have sent them. Use this to test how the agent handles a photo or a document: a vision-capable model receives the image itself, a text-only one receives a one-line description of it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / reply_to_agent_id
      Added value: +{
      +  "description": "The Claude Code agent whose session should receive the answer (normally your own agent, when you are a Claude Code session asking another one). A Claude Code agent answers later, not in this call (status='delegated'); with this set, its answer is delivered to your session as a new message. Without it the answer is only on the trace (agents.trace_get). Must be a Claude Code agent of this workspace, not the one asked. Ignored for other agents, which answer in this call.",
      +  "type": "integer"
      +}
  2. Changed1 schema field changed
    • addedInput schema / properties / in_workspace
      Added value: +{
      +  "description": "Run this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected.",
      +  "type": "integer"
      +}
  3. Added
  4. Removed
  5. Changed1 schema field changed
    • changedInput schema / properties / background / description
      Previous value: -"Run detached from this MCP connection. Returns immediately with status='started'; the run survives client timeouts and disconnects (up to 15 min). Poll agents.traces_list for the outcome. Use for runs expected to exceed ~2 minutes — a synchronous call is cancelled when the MCP request dies."New value: +"Run detached from this MCP connection. Returns immediately with status='started'; the run survives client timeouts and disconnects (up to 15 min). Poll agents.traces_list for the outcome. Use for runs expected to exceed ~2 minutes — a synchronous call is cancelled when the MCP request dies. OMIT to run synchronously and get the answer in this call (the default)."
  6. Changed1 schema field changed
    • addedInput schema / properties / background
      Added value: +{
      +  "description": "Run detached from this MCP connection. Returns immediately with status='started'; the run survives client timeouts and disconnects (up to 15 min). Poll agents.traces_list for the outcome. Use for runs expected to exceed ~2 minutes — a synchronous call is cancelled when the MCP request dies.",
      +  "type": "boolean"
      +}
  7. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations (non-read-only, non-idempotent, non-destructive), the description discloses the important operational traits: latency of 10–60s, that synchronous calls die with the MCP request while background runs survive up to 15 minutes, and the exact semantic of status='silent'. That is precisely the context the annotations cannot convey.

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 core action is front-loaded in one sentence, followed by return shape, then execution timing. The messages[]/full_reply contrast is slightly dense and could be tightened, but every paragraph carries usable information rather than restating the name.

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?

There is no output schema, so the description carries the full return contract — and it does, field by field, including status values, tool_calls[] trace contents, and the messages[] attachment shape. For an async-capable, network-touching tool like this, an agent has everything needed to call it correctly.

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 the baseline is 3, but the description goes beyond the schema by tying parameters to observable outcomes, for example background=true returning status='started' and full_reply omitting attachment-only sends that still appear in messages[]. No syntax or format additions are needed, and no parameter is left unexplained.

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 opening line states a concrete verb and resource ('Send a message to an AI agent and get its response') and immediately narrows the scope ('Use this to test agents or have them process a task'). The reader can distinguish it from sibling tools such as agents_simulate_inbound or agents_traces_list, which are named only as downstream polling targets.

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?

There is real conditional guidance: use background=true for runs expected to exceed ~2 minutes, omit it for synchronous answers, and set reply_to_agent_id only when a Claude Code session should receive the answer later. What's missing is an explicit 'use X instead' routing line against close siblings, particularly agents_simulate_inbound, which sends an inbound message in a different way.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources