Skip to main content
Glama
thenvoi

Thenvoi MCP Server

Official
by thenvoi

get_agent_next_message

Retrieve the next unprocessed message from a chat to continue your agent's reasoning loop. Handles crash recovery by returning stuck messages.

Instructions

Get the next message that needs processing.

Returns the single oldest message that is NOT processed, including
new, delivered, processing (stuck/crashed), and failed messages.

Returns empty result if there are no messages to process.

This is the primary endpoint for agent reasoning loops:
1. Call this tool to get the next work item
2. Call mark_agent_message_processing to claim the message
3. Process the message (reasoning, tool calls, etc.)
4. Call mark_agent_message_processed or mark_agent_message_failed
5. Loop back to step 1

Crash recovery: If the agent crashes while processing, the message stays
in "processing" state. When restarted, calling this tool returns that same
stuck message (oldest first), allowing the agent to reclaim and retry it.

Difference from list_agent_messages:
- list_agent_messages returns ALL actionable messages (batch processing)
- get_agent_next_message returns ONE message (sequential processing loops)

Args:
    chat_id: The unique identifier of the chat room (required).

Returns:
    JSON string containing the next message to process, or empty if none.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chat_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations provided, the description fully discloses behavioral traits such as returning messages in various states (new, delivered, processing, failed), handling crash recovery by returning stuck messages, and returning empty results when none exist. No contradictions.

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 description is well-structured with sections and bullet points, front-loaded with the main purpose. While slightly lengthy, every sentence adds value, explaining behavior, usage, and comparison. It earns its length.

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?

Given a single parameter and an output schema, the description is complete. It covers return values (JSON string or empty), behavior (oldest first, includes stuck messages), and use cases (sequential processing loops). No gaps.

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 description adds an 'Args' section explaining 'chat_id' as 'The unique identifier of the chat room (required)', which adds meaning beyond the input schema's title 'Chat Id'. Schema coverage is 0%, so the description compensates well.

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 'Get the next message that needs processing' and specifies it returns the single oldest unprocessed message. It explicitly distinguishes from the sibling tool 'list_agent_messages' which returns all messages, providing strong differentiation.

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?

The description includes a step-by-step workflow for an agent reasoning loop, explaining when to call this tool (to get the next work item) and explicitly contrasts with 'list_agent_messages' for batch processing. It also covers crash recovery scenarios.

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/thenvoi/thenvoi-mcp'

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