Skip to main content
Glama
carterlasalle

mac-messages-mcp

tool_get_chats

Retrieve group chat listings from macOS Messages app to access conversation history and manage communication threads.

Instructions

List available group chats from the Messages app.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The tool_get_chats function implements the core logic for retrieving and formatting available group chats from the Messages database. It is registered via the @mcp.tool() decorator.
    @mcp.tool()
    def tool_get_chats(ctx: Context) -> str:
        """
        List available group chats from the Messages app.
        """
        logger.info("Getting available chats")
        try:
            query = "SELECT chat_identifier, display_name FROM chat WHERE display_name IS NOT NULL"
            results = query_messages_db(query)
            
            if not results:
                return "No group chats found."
            
            if "error" in results[0]:
                return f"Error accessing chats: {results[0]['error']}"
            
            # Filter out chats without display names and format the results
            chats = [r for r in results if r.get('display_name')]
            
            if not chats:
                return "No named group chats found."
            
            formatted_chats = []
            for i, chat in enumerate(chats, 1):
                formatted_chats.append(f"{i}. {chat['display_name']} (ID: {chat['chat_identifier']})")
            
            return "Available group chats:\n" + "\n".join(formatted_chats)
        except Exception as e:
            logger.error(f"Error getting chats: {str(e)}")
            return f"Error getting chats: {str(e)}"
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. It states the action ('List') but does not specify whether this is a read-only operation, what permissions are needed, how results are returned (e.g., pagination, format), or any rate limits. This leaves significant gaps for an agent to understand the tool's behavior.

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 a single, clear sentence with no wasted words. It is front-loaded with the core action and resource, making it highly efficient and easy to parse for an agent.

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

Completeness3/5

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

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is minimally adequate. It states what the tool does but lacks details on behavior, output format, and usage context, which are needed for full completeness in a no-annotation scenario.

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 tool has 0 parameters, and schema description coverage is 100%, so there are no parameters to document. The description does not need to add parameter semantics, and it appropriately avoids unnecessary details, earning a high baseline score for this dimension.

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 verb ('List') and resource ('available group chats from the Messages app'), making the purpose specific and understandable. However, it does not explicitly differentiate from sibling tools like 'tool_get_recent_messages' or 'tool_fuzzy_search_messages', which prevents a perfect 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 such as 'tool_get_recent_messages' for recent messages or 'tool_fuzzy_search_messages' for searching. There is no mention of prerequisites, context, or exclusions, leaving usage unclear.

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/carterlasalle/mac_messages_mcp'

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