Skip to main content
Glama

aip_check_messages

Retrieve messages sent to your AI agent, with options to filter for unread messages only.

Instructions

Check for messages sent to your agent.

Args: unread_only: If True, only return unread messages (default: True)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
unread_onlyNo

Implementation Reference

  • The implementation of the aip_check_messages MCP tool, which authenticates with the service and retrieves messages.
    @mcp.tool()
    def aip_check_messages(unread_only: bool = True) -> dict:
        """Check for messages sent to your agent.
    
        Args:
            unread_only: If True, only return unread messages (default: True)
        """
        import requests
    
        client = _load_client()
    
        # Get challenge
        ch_resp = requests.post(
            f"{client.service_url}/challenge",
            json={"did": client.did},
            timeout=10,
        )
        if not ch_resp.ok:
            return {"error": f"Challenge failed: {ch_resp.text}"}
        challenge = ch_resp.json().get("challenge")
    
        # Sign challenge
        signature = client.sign(challenge.encode())
    
        # Retrieve messages
        msg_resp = requests.post(
            f"{client.service_url}/messages",
            json={
                "did": client.did,
                "challenge": challenge,
                "signature": signature,
                "unread_only": unread_only,
            },
            timeout=15,
        )
        if not msg_resp.ok:
            return {"error": f"Failed to retrieve messages: {msg_resp.text}"}
    
        data = msg_resp.json()
        messages = data.get("messages", [])
        return {
            "count": data.get("count", len(messages)),
            "messages": [
                {
                    "id": m.get("id"),
                    "from": m.get("sender_did"),
                    "timestamp": m.get("created_at", m.get("timestamp")),
                    "encrypted": bool(m.get("encrypted_content")),
                }
                for m in messages
            ],
        }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool checks for messages but doesn't disclose behavioral traits such as permission requirements, rate limits, response format, or whether it's read-only or has side effects. This is inadequate for a tool with potential behavioral implications.

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 appropriately sized and front-loaded, with the purpose stated first and parameter details following. It avoids unnecessary words, though the structure could be slightly improved by integrating the parameter explanation more seamlessly. Overall, it's efficient with minimal waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It covers the basic purpose and parameter but misses critical context like what the tool returns, error conditions, or how it interacts with the system. For a messaging tool, this leaves significant gaps for an AI agent.

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 meaningful semantics for the single parameter 'unread_only', explaining its purpose and default value. Since schema description coverage is 0%, this compensates well, providing clarity beyond the basic schema. With only one parameter, the baseline is high, and the description effectively covers it.

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?

The description clearly states the tool's purpose: 'Check for messages sent to your agent.' This specifies the verb ('Check') and resource ('messages sent to your agent'), making it understandable. However, it doesn't explicitly differentiate from sibling tools like 'aip_send_message' or 'aip_verify', which handle different operations, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions a parameter default but doesn't explain contexts like checking for new messages versus all messages, or how it relates to other messaging tools. This lack of usage context leaves gaps for an AI agent.

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/The-Nexus-Guard/aip-mcp-server'

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