Skip to main content
Glama

check

Monitor for incoming messages in Claude IPC MCP to maintain communication flow between AI assistants using instance-specific tracking.

Instructions

Check for new messages

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instance_idYesYour instance ID

Implementation Reference

  • Registration of the 'check' MCP tool including its input schema requiring 'instance_id'.
    Tool(
        name="check",
        description="Check for new messages",
        inputSchema={
            "type": "object",
            "properties": {
                "instance_id": {
                    "type": "string",
                    "description": "Your instance ID"
                }
            },
            "required": ["instance_id"]
        }
  • MCP tool handler for 'check' that delegates to the internal message broker via BrokerClient and formats the retrieved messages for display.
    elif name == "check":
        if not current_session_token:
            return [TextContent(type="text", text="Error: Not registered. Please register first.")]
            
        response = BrokerClient.send_request({
            "action": "check",
            "instance_id": arguments["instance_id"],
            "session_token": current_session_token
        })
        
        if response["status"] == "ok" and response.get("messages"):
            formatted = "New messages:\n"
            for msg in response["messages"]:
                formatted += f"\nFrom: {msg['from']}\n"
                formatted += f"Time: {msg['timestamp']}\n"
                formatted += f"Content: {msg['message']['content']}\n"
                if msg['message'].get('data'):
                    formatted += f"Data: {json.dumps(msg['message']['data'], indent=2)}\n"
            return [TextContent(type="text", text=formatted)]
        else:
            return [TextContent(type="text", text="No new messages")]
  • Internal MessageBroker handler for 'check' action: retrieves, clears unread messages for the instance, and marks them as read in the SQLite database.
    elif action == "check":
        # instance_id already validated and set from session
        instance_id = request["instance_id"]
        
        # Resolve name through forwarding if needed
        resolved_id = self._resolve_name(instance_id)
        
        if resolved_id not in self.queues:
            return {"status": "ok", "messages": []}
            
        messages = self.queues[resolved_id]
        self.queues[resolved_id] = []
        
        # Mark messages as read in database
        if self.db_path and messages:
            try:
                conn = sqlite3.connect(self.db_path)
                cursor = conn.cursor()
                
                # Get message IDs to mark as read
                for msg in messages:
                    cursor.execute('''
                        UPDATE messages 
                        SET read_flag = 1 
                        WHERE to_id = ? AND timestamp = ? AND read_flag = 0
                    ''', (resolved_id, msg.get("timestamp")))
                
                conn.commit()
                conn.close()
            except Exception as e:
                logger.error(f"Failed to mark messages as read: {e}")
        
        return {"status": "ok", "messages": messages}
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal insight. It mentions checking for 'new messages' but doesn't specify whether this is a read-only operation, how it interacts with the system (e.g., polling frequency, side effects), or what authentication or rate limits apply. The description fails to compensate for the lack of annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just three words, with no wasted language. It is front-loaded with the core action ('Check'), making it easy to parse. Every word earns its place, though this conciseness comes at the cost of detail in other dimensions.

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?

For a tool with no annotations, no output schema, and a single but critical parameter, the description is insufficient. It doesn't explain what 'new messages' means in context, what the tool returns, or how it differs from other message-related operations. The lack of behavioral and output information leaves significant gaps for an agent to understand and use the tool effectively.

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?

The input schema has 100% description coverage, with the single parameter 'instance_id' clearly documented as 'Your instance ID'. The description adds no additional meaning beyond what the schema provides, such as explaining how the instance ID relates to message checking. Given the high schema coverage, the baseline score of 3 is appropriate.

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

Purpose2/5

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

The description 'Check for new messages' states a general action but lacks specificity about what resource is being checked. It doesn't distinguish this tool from potential siblings like 'list_instances' or 'auto_process' that might also involve message handling. The description is vague about scope and target, falling short of the clarity needed for effective tool selection.

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?

No guidance is provided on when to use this tool versus alternatives. With siblings like 'list_instances', 'send', and 'auto_process', the description offers no context about whether this is for polling, notification checking, or status updates. The agent receives no help in determining the appropriate scenario for invoking this tool.

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/jdez427/claude-ipc-mcp'

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