Skip to main content
Glama
jonmmease
by jonmmease

get_message_context

Retrieve surrounding messages from an iMessage conversation to understand context around a specific message, providing chronological order with the target marked.

Instructions

Get messages surrounding a specific message in the same conversation.

Use this to get context around a message found via search. Returns messages from the same chat/thread, ordered chronologically, with the target message marked.

Args: rowid: The rowid of the message to get context for before: Number of messages to fetch before the target (default: 5) after: Number of messages to fetch after the target (default: 5)

Returns: Dictionary with: - messages: List of messages in chronological order - target_index: Index of the target message in the list - chat_id: The chat ID for the conversation - chat_identifier: The chat identifier (phone/email/group)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rowidYes
beforeNo
afterNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: it returns messages 'ordered chronologically' with the target 'marked', specifies the return structure, and implies it's a read-only operation (no destructive language). However, it doesn't mention permissions, rate limits, or error conditions, leaving some gaps.

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 front-loaded with the core purpose, followed by usage guidelines, then parameter details, and finally return values. Every sentence earns its place with no redundancy, making it efficient and well-structured for quick comprehension.

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 the tool's moderate complexity (3 parameters, 1 required), no annotations, and the presence of an output schema (implied by the 'Returns' section), the description is complete. It covers purpose, usage, parameters, and return structure, leaving no significant gaps for an agent to operate effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It fully documents all three parameters: 'rowid' as 'The rowid of the message to get context for', 'before' as 'Number of messages to fetch before the target', and 'after' as 'Number of messages to fetch after the target', including default values. This adds complete meaning beyond the bare 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 specific action ('Get messages surrounding a specific message') and resource ('in the same conversation'), distinguishing it from siblings like 'get_conversation_messages' (which likely gets all messages) and 'search_messages' (which searches across conversations). The phrase 'surrounding a specific message' precisely defines the scope.

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?

It explicitly states when to use this tool: 'Use this to get context around a message found via search.' This directly contrasts with 'search_messages' (for finding messages) and 'get_conversation_messages' (for getting all messages in a conversation), providing clear alternative guidance.

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

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