Skip to main content
Glama

get_context

Read-only

The messages around one message, in its chat, oldest first; it has hit: true.

Instructions

The messages around one message, in its chat, oldest first; it has hit: true.

Use it when a search result is relevant but needs what was said around it: the question it answers, the reply, what "it" refers to.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
afterNoMessages after it. Default 5.
beforeNoMessages before it. Default 5.
memory_idYesThe id of a search result, exactly as given

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
messagesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changedv0.4.7
    • addedInput schema / properties / after / description
      Added value: +"Messages after it. Default 5."
    • addedInput schema / properties / after / maximum
      Added value: +50
    • addedInput schema / properties / after / minimum
      Added value: +0
    • addedInput schema / properties / before / description
      Added value: +"Messages before it. Default 5."
    • addedInput schema / properties / before / maximum
      Added value: +50
    • addedInput schema / properties / before / minimum
      Added value: +0
    • addedInput schema / properties / memory_id / description
      Added value: +"The id of a search result, exactly as given"
    • addedOutput schema / $defs
      Added value: +{
      +  "Message": {
      +    "properties": {
      +      "chat": {
      +        "description": "The group's name, or the other person in a one-to-one chat",
      +        "title": "Chat",
      +        "type": "string"
      +      },
      +      "content": {
      +        "description": "The message, as stored: usually 'sender: text'",
      +        "title": "Content",
      +        "type": "string"
      +      },
      +      "date": {
      +        "description": "When it was sent, YYYY-MM-DD HH:MM, owner's time zone",
      +        "title": "Date",
      +        "type": "string"
      +      },
      +      "deleted": {
      +        "description": "Deleted for everyone after it was read",
      +        "title": "Deleted",
      +        "type": "boolean"
      +      },
      +      "group": {
      +        "description": "True for a group chat",
      +        "title": "Group",
      +        "type": "boolean"
      +      },
      +      "hit": {
      +        "description": "The message get_context was asked about",
      +        "title": "Hit",
      +        "type": "boolean"
      +      },
      +      "id": {
      +        "description": "Pass to get_context to read around this message",
      +        "title": "Id",
      +        "type": "string"
      +      },
      +      "platform": {
      +        "description": "imessage, whatsapp, signal, …",
      +        "title": "Platform",
      +        "type": "string"
      +      },
      +      "sender": {
      +        "description": "Who wrote it; 'me' is the owner",
      +        "title": "Sender",
      +        "type": "string"
      +      },
      +      "source": {
      +        "description": "The chat's id, for the source filter",
      +        "title": "Source",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "date",
      +      "platform",
      +      "chat",
      +      "group",
      +      "sender",
      +      "content",
      +      "source"
      +    ],
      +    "title": "Message",
      +    "type": "object"
      +  }
      +}
    • addedOutput schema / properties / messages
      Added value: +{
      +  "items": {
      +    "$ref": "#/$defs/Message"
      +  },
      +  "title": "Messages",
      +  "type": "array"
      +}
    • removedOutput schema / properties / result
      Removed value: -{
      -  "items": {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  "title": "Result",
      -  "type": "array"
      -}
    • changedOutput schema / required
      Previous value: -[
      -  "result"
      -]New value: +[
      +  "messages"
      +]
    • changedOutput schema / title
      Previous value: -"get_contextOutput"New value: +"Context"
  2. First observedv0.2.2

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, covering the safety profile. The description adds one useful behavioral trait, the ordering ('oldest first'), but the clause 'it has hit: true' is opaque and discloses no clear state. With annotations carrying safety, this is an adequate but not rich addition.

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

Conciseness4/5

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

Two short sentences, front-loaded with what it returns and followed by the usage cue; there is little waste. The 'it has hit: true' fragment is the one piece that does not earn its place, keeping it from a 5.

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?

An output schema exists, so return values need not be re-explained. The description covers what is returned, the ordering, and the chaining scenario, which is sufficient for a 3-parameter read tool, though naming the sibling search tool would fully close the loop.

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?

Schema description coverage is 100%, so before/after/memory_id are fully documented in the schema itself, including defaults and the 'exactly as given' note. The description adds no parameter syntax or meaning beyond that, so the baseline of 3 is appropriate.

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?

It states the resource clearly (the messages around one message, in its chat, oldest first), giving an agent enough to know it returns surrounding context rather than a message itself. The lack of an explicit verb and the cryptic trailing clause 'it has hit: true' slightly muddy it, but the core purpose is unambiguous.

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

Usage Guidelines4/5

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

It says exactly when to reach for it: when a search result is relevant but needs the surrounding exchange (the question it answers, the reply, what 'it' refers to). That is a strong chaining cue after a search. No exclusions or explicit sibling name (e.g. search_memoreei) are given, so it stops short of a 5.

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