Skip to main content
Glama

get_my_info

Retrieve your iMessage self-handles and chat database metadata to verify your identity and data integrity.

Instructions

Return self-handles and chat.db metadata for sanity checks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that queries chat.db for the user's own handles (destination_caller_id and account_login), total message count, earliest message date, and DB path.
    def get_my_info() -> dict[str, Any]:
        with _open() as conn:
            handles = [
                r[0]
                for r in conn.execute(
                    "SELECT DISTINCT destination_caller_id FROM message WHERE destination_caller_id IS NOT NULL AND destination_caller_id != ''"
                ).fetchall()
            ]
            login_rows = [
                r[0]
                for r in conn.execute(
                    "SELECT DISTINCT account_login FROM chat WHERE account_login IS NOT NULL AND account_login != ''"
                ).fetchall()
            ]
            for h in login_rows:
                h_clean = h.replace("E:", "").replace("P:", "")
                if h_clean and h_clean not in handles:
                    handles.append(h_clean)
            total = conn.execute("SELECT COUNT(*) FROM message").fetchone()[0]
            earliest = conn.execute("SELECT MIN(date) FROM message WHERE date > 0").fetchone()[0]
            return {
                "my_handles": handles,
                "db_path": str(DB_PATH),
                "messages_count": total,
                "earliest_date": apple_ts_to_iso(earliest),
            }
  • MCP tool registration decorator that exposes get_my_info as a tool, delegating to db.get_my_info().
    @mcp.tool()
    def get_my_info() -> dict[str, Any]:
        """Return self-handles and chat.db metadata for sanity checks."""
        return db.get_my_info()
  • Helper function that converts Apple epoch timestamps to ISO8601 strings, used for the earliest_date field.
    def apple_ts_to_iso(apple_ts: int | None) -> str | None:
        """Convert Apple Core Data timestamp to ISO8601 UTC string.
    
        Newer macOS stores date as nanoseconds since 2001-01-01 UTC.
        Older rows stored plain seconds. Heuristic: values > 1e11 are nanoseconds.
        """
        if apple_ts is None or apple_ts == 0:
            return None
        if apple_ts > 10**11:
            unix_ts = apple_ts / 1_000_000_000 + APPLE_EPOCH_OFFSET
        else:
            unix_ts = apple_ts + APPLE_EPOCH_OFFSET
        return datetime.fromtimestamp(unix_ts, tz=timezone.utc).isoformat()
Behavior3/5

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

No annotations are provided, so the description must carry full behavioral disclosure. It indicates a read operation returning handles and metadata, but does not mention side effects, authentication needs, or specific data format. The output schema exists but is not described.

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?

A single, focused sentence that efficiently conveys the tool's purpose without extraneous information. Every word adds value.

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

Completeness4/5

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

Given zero parameters and the existence of an output schema, the description is mostly complete for a simple info-retrieval tool. It covers the essential purpose and scope, though it could mention that it's read-only.

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?

There are no parameters, so baseline is 4. The description adds meaning by specifying what is returned (self-handles and metadata), which goes beyond the empty schema.

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 the verb 'Return' and the objects 'self-handles and chat.db metadata', specifying the exact resource and action. It distinguishes from siblings which deal with messages, chats, contacts, and sending.

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

Usage Guidelines3/5

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

The phrase 'for sanity checks' provides context on when to use, but it does not explicitly state when not to use or mention alternatives among siblings. Usage guidance is implied but not comprehensive.

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/camfortin/imessage-mcp'

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