Skip to main content
Glama
contextstream

ContextStream MCP Server

Get smart context for user query

context
Read-onlyIdempotent

Retrieves relevant context for AI responses by analyzing user messages and returning token-efficient, minified information to replace full chat history in prompts.

Instructions

CALL THIS BEFORE EVERY AI RESPONSE to get relevant context.

This is the KEY tool for token-efficient AI interactions. It:

  1. Analyzes the user's message to understand what context is needed

  2. Retrieves only relevant context in a minified, token-efficient format

  3. Replaces the need to include full chat history in prompts

Format options:

  • 'minified': Ultra-compact D:decision|P:preference|M:memory (default, ~200 tokens)

  • 'readable': Line-separated with labels

  • 'structured': JSON-like grouped format

Type codes: W=Workspace, P=Project, D=Decision, M=Memory, I=Insight, T=Task, L=Lesson

Context Pack:

  • mode='pack' adds code context + distillation (higher credit cost)

Example usage:

  1. User asks "how should I implement auth?"

  2. AI calls context(user_message="how should I implement auth?")

  3. Gets: "W:Maker|P:contextstream|D:Use JWT for auth|D:No session cookies|M:Auth API at /auth/..."

  4. AI responds with relevant context already loaded

This saves ~80% tokens compared to including full chat history.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_messageYesThe user message to analyze and get context for
workspace_idNoWorkspace ID (UUID).
project_idNoProject ID (UUID).
max_tokensNoMaximum tokens for context (default: 800)
formatNoContext format (default: minified)
modeNoContext pack mode (default: pack when enabled)
distillNoUse distillation for context pack (default: true)
session_tokensNoCumulative session token count for context pressure calculation
context_thresholdNoCustom context window threshold (defaults to 70k)
save_exchangeNoSave this exchange to the transcript for later search (background task)
session_idNoSession ID for transcript association (required if save_exchange is true)
client_nameNoClient name for transcript metadata (e.g., 'claude', 'cursor')
assistant_messageNoPrevious assistant response to save along with user message (for complete exchange capture)
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=false, covering safety and idempotency. The description adds valuable context beyond annotations: it explains token efficiency benefits ('saves ~80% tokens'), format options with details, type codes, and the 'context pack' mode with higher credit cost. However, it doesn't mention rate limits, authentication needs, or error behaviors, keeping it from a perfect score.

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?

The description is well-structured with bullet points, examples, and clear sections, making it easy to scan. It's appropriately sized for a complex tool with many parameters. However, some parts could be more concise (e.g., the example usage is detailed but slightly verbose), and the opening 'CALL THIS BEFORE EVERY AI RESPONSE' is emphasized effectively but repeated in essence.

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?

Given the tool's complexity (13 parameters, no output schema) and rich annotations, the description is mostly complete. It covers purpose, usage, formats, and benefits thoroughly. However, it lacks details on output structure (since no output schema exists) and doesn't explain all parameter interactions (e.g., how mode and distill work together). For a tool with this many options, slightly more guidance on outputs would help.

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 the schema fully documents all 13 parameters. The description adds some semantic context: it explains format options ('minified', 'readable', 'structured') with examples and mentions 'mode='pack' adds code context + distillation'. However, it doesn't elaborate on most parameters like max_tokens, distill, or session_tokens beyond what the schema provides. With high schema coverage, the baseline is 3.

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 tool's purpose: 'get relevant context' by analyzing user messages and retrieving token-efficient context. It distinguishes from siblings by emphasizing this is the 'KEY tool for token-efficient AI interactions' that 'replaces the need to include full chat history in prompts', unlike search, memory, or other tools that might handle specific data types.

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?

Explicit guidance is provided: 'CALL THIS BEFORE EVERY AI RESPONSE' and 'This is the KEY tool for token-efficient AI interactions'. The description explains when to use it (before responses to get context efficiently) and implies when not to use it (when full chat history or specific data like projects/workspaces are needed, which sibling tools might handle). The example usage further clarifies the workflow.

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/contextstream/mcp-server'

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