mq_recv
Receive and process messages for AI agents by polling the Agent-MQ message queue, enabling cross-session and cross-machine communication between coding agents.
Instructions
Receive and consume messages for an agent. Poll periodically to check for new messages.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| msg_type | No |
Implementation Reference
- mcp/src/index.ts:35-41 (handler)Registration and handler implementation of the "mq_recv" MCP tool, which calls the client's `recv` function.
server.tool("mq_recv", "Receive and consume messages for an agent. Poll periodically to check for new messages.", { name: z.string(), msg_type: z.string().optional(), }, async ({ name, msg_type }) => { const msgs = await client.recv(name, msg_type || undefined) as unknown[]; return { content: msgs.map(m => ({ type: "text" as const, text: JSON.stringify(m) })) }; }); - mcp/src/client.ts:88-91 (handler)The underlying client logic that performs the HTTP request to the message queue server for receiving messages.
export async function recv(name: string, msgType?: string) { const params = msgType ? `?type=${msgType}` : ""; return api("GET", `/recv/${name}${params}`); }