Skip to main content
Glama

Get context for a message

rhebok_get_context
Read-onlyIdempotent

Retrieves saved memories and excerpts matched to the user's exact message. Use it before answering questions about their projects, code, notes, decisions, or past sessions.

Instructions

Get the excerpts and saved memories that belong with the user's current message, chosen and size-limited like the automatic prompt hook, with more time to search. It takes the user's message; rhebok_search_knowledge takes a query you write.

Use it before answering whenever the message touches the user's own work: their projects, code, notes, decisions, past sessions, people or plans. Skip it when the message already contains a block, or when it asks about general knowledge. Use rhebok_search_knowledge for later, narrower lookups.

Parameters: pass message exactly as the user wrote it, typos included. The relevance gate is calibrated on real prompts, so a summary or a rewrite is judged against the wrong bar. cwd decides which project's memories count, so pass the working directory whenever you know it. prehook and session belong to rhebok's own Claude Code mod: never set them.

Behavior: it embeds the message through the configured embedding server and usually answers within a second. It changes nothing in the index or in the saved memories.

Returns: block, ready to read as context, or null when nothing cleared the gate, which is a normal answer; hits, the title and uri of each excerpt in the block; and notes, which says when retrieval was degraded, for example because the embedding server was unreachable.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "message": "<message>"
    },
    "name": "rhebok_get_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdNoThe absolute path of the directory the user is working in. It selects the rhebok project the message belongs to. Omit when unknown.
messageYesThe user's message, exactly as they wrote it. Do not summarise or rephrase it: the gate is calibrated against real prompts.
prehookNoLeave unset. Set only by the rhebok-prehook mod: answer without searching unless `[prehook] injector` is `mod`.
sessionNoLeave unset. The Claude Code session id, sent by the rhebok-prehook mod so the command hook knows the mod is injecting there.

Output Schema

NameRequiredDescriptionDefault
hitsYesThe sources quoted in `block`, most relevant first.
blockYesThe context to use, as a <rhebok-context> block of excerpts and memories. Null when nothing cleared the relevance gate, which is a normal answer.
notesYesWhy retrieval was degraded or partial, for example an unreachable embedding server or a skipped mount. Empty on a normal answer.
projectYesThe rhebok project `cwd` belongs to, when it belongs to one.
skippedYesWhy no search ran at all, for example a message too short to search on.
injectorNoSet only for the rhebok-prehook mod: which injector is configured.
budget_msYesThe time budget the lookup ran under, in milliseconds.
elapsed_msYesHow long the lookup took, in milliseconds.
status_styleNoSet only for the rhebok-prehook mod: how it should show its status.
untrusted_project_fileYesA project file found under `cwd` that is ignored because the user has not trusted it yet.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.4

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the readOnly/idempotent annotations, it discloses the embedding-server dependency, expected latency (~1 second), that nothing in the index or saved memories changes, that a null block is a normal answer rather than an error, and that `notes` signals degraded retrieval. This is substantial behavioral context an agent needs to interpret empty results and failures correctly.

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?

Front-loaded with purpose and alternative, then organized into clear Parameters/Behavior/Returns sections. Slightly long, and a few sentences duplicate schema descriptions, but no filler.

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?

For a four-parameter read tool with annotations and an output schema, nothing material is missing: purpose, routing, parameter intent, failure semantics, and return shape are all covered.

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?

Schema coverage is 100%, so the baseline is 3; the description earns more by adding the rationale behind verbatim `message` input ('the relevance gate is calibrated on real prompts, so a summary or a rewrite is judged against the wrong bar') and by explaining that `cwd` selects which project's memories count. The `prehook`/`session` warning largely restates the schema's 'Leave unset' text.

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?

States a specific verb and resource — 'get the excerpts and saved memories that belong with the user's current message' — and immediately contrasts it with rhebok_search_knowledge ('takes a query you write'), so the agent can distinguish the two without opening either schema.

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?

Gives explicit trigger conditions ('before answering whenever the message touches the user's own work'), explicit exclusions ('skip it when the message already contains a <rhebok-context> block, or when it asks about general knowledge'), and names the alternative for narrower follow-up lookups.

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