Skip to main content
Glama

get_message_context

Read-only

Reads surrounding messages before and after a given session message, reporting clearly when that context is not available instead of guessing.

Instructions

按会话和localId读取消息前后语境;找不到时明确报告未覆盖,不猜测上下文。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
afterNo
beforeNo
offsetNo
local_idYes
scan_limitNo
session_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.1.1

TDQS

B3.4/5.0
Behavior4/5

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

Annotations declare readOnlyHint=true and destructiveHint=false, so the safety profile is clear. The description adds useful behavioral detail beyond annotations: it explicitly states that if the message is not found, the tool reports it as uncovered and does not guess context. This is valuable context for the agent's expectations.

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 sentence that front-loads the core action and includes the failure behavior. It is concise with no filler, earning its place.

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 six parameters, two required, and no output schema or parameter descriptions, the description is too brief. It covers the required parameters but leaves the optional ones unexplained, and it does not describe the return format or structure. An agent would have to guess the meaning of after/before/offset/scan_limit, which is a significant omission for a tool with this complexity.

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

Parameters2/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 mentions session_id and local_id by name, but does not explain the other four parameters (after, before, offset, scan_limit). Without any schema descriptions, the agent cannot infer their purpose or constraints from the tool description alone, leaving a significant gap.

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 states a clear action: reading message context (before/after) by session and localId. It also specifies behavior when the message is not found. This distinguishes it from siblings like search_messages or get_recent_messages, though it does not explicitly name an alternative.

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 description implies usage: when you need surrounding context for a specific message. However, it does not explicitly state when not to use it or mention alternatives like search_messages or get_recent_messages. There is no guidance on selecting this over other context-related tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.