Skip to main content
Glama

context_prepare

Pre-LLM pipeline: session append → compress incoming history → enrich.

Returns compressed messages, optional additional_context (org memory), session_id, and stats. Use before sending a turn to your LLM when you want teamshared to shrink tool bloat and inject recall. Server-side MCP middleware already normalizes teamshared tool responses; this covers the rest of the prompt.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoNoWorkspace slug for scoped recall enrichment.
enrichNoAssemble org memory and append as `additional_context`.
githubNoGitHub `owner/repo` for scoped recall enrichment.
promptNoLatest user prompt when you do not have full message history.
messagesNoOpenAI-style chat messages to run through the pre-LLM pipeline. Provide this or `prompt`.
session_idNoWorking-memory session to append the user turn to.
token_budgetNoSoft token cap for assembled context.
append_sessionNoAppend the latest user message to the working session.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior3/5

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

No annotations are present, so the description carries the burden. It discloses the pipeline stages and return payload, and it clarifies that teamshared normalization is already handled elsewhere. But it does not state whether session append persists state, whether compression discards messages, or any side effects or permissions, which matters for a tool that mutates a working session.

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?

Three short sentences front-load the purpose and returns, then give the usage context and scope. No filler; the pipeline arrow notation is efficient and every sentence earns its place.

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

Completeness3/5

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

The description covers purpose, return values, and usage timing, and the output schema handles return structure. But with eight parameters and siblings like context_compress, context_normalize, and memory_assemble_context, it does not fully disambiguate when to choose this tool over those, nor does it mention the messages-vs-prompt requirement or side effects.

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 coverage is 100%, so the schema already documents all 8 parameters. The description adds no parameter-level detail beyond the schema; it only restates the concepts of session append, compression, and enrichment. Baseline 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?

The description opens with a concrete pipeline ('session append → compress incoming history → enrich') and lists the exact return fields, so an agent can tell this is a pre-LLM context assembly tool. It gestures at differentiation by saying it 'covers the rest of the prompt' after middleware normalizes teamshared responses, but it never names a sibling such as context_compress or memory_assemble_context.

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 gives an explicit trigger: 'Use before sending a turn to your LLM when you want teamshared to shrink tool bloat and inject recall.' It also clarifies scope relative to server-side middleware. However, it provides no exclusions or named alternatives for cases like standalone compression (context_compress) or memory-only assembly (memory_assemble_context).

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.