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

TableJSON 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.
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 / 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"
      +}
  2. Added
  3. Removed
  4. 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)."
  5. 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"
      +}
  6. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Annotations only give the coarse safety profile (non-read-only, non-destructive, non-idempotent, closed-world). The description adds real behavioral context: execution takes 10-60s, background runs detach from the connection and survive up to 15 min, status='silent' is defined precisely, and it explains that a synchronous call is cancelled if the MCP request dies. This is well beyond what the annotations 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?

Purpose is front-loaded in the first line, then return shape and execution semantics. It is dense and the return-value enumeration is long, but nearly every clause carries usable information (status semantics, full_reply vs messages distinction, attachment handling). Slightly verbose for a definition but well-structured.

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?

With no output schema, the description carries the full burden of explaining returns and does so thoroughly (status values, messages[], full_reply, tool_calls[] trace, model/tokens). Combined with the background/synchronous tradeoff and attachment behavior, 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.

Parameters3/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 six parameters, and much of the description's parameter text (send_mode vs execution_mode, background, attachments) mirrors the schema. It adds marginal framing but does not materially extend meaning beyond the structured fields, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource: send a message to an AI agent and get its response, plus the scope that the agent runs with its own prompt/tools/knowledge. An agent can tell this apart from pure-read siblings like agents_get or agents_traces_list. It stops short of explicitly naming the sibling alternatives (e.g. agents_simulate_inbound, calls_dispatch_agent), so 4 rather than 5.

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?

Gives clear context: 'Use this to test agents or have them process a task.' It also gives conditional guidance for background=true (runs expected to exceed ~2 minutes) vs the synchronous default. It does not name when NOT to use it or point at specific alternative siblings, so it lands at 4.

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.