Skip to main content
Glama
contextstream

ContextStream MCP Server

Get smart context for user query

context
Read-onlyIdempotent

Analyze user messages to retrieve only relevant data in a compact format, reducing token usage by omitting full chat history.

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 mode: standard (default), pack (includes code context), fast (cached quick response)
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 indicate read-only, non-destructive, idempotent behavior. The description adds value by explaining token savings, format details, and background task for saving exchanges. No contradictions.

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 and an example, but it is somewhat lengthy. It front-loads the key instruction, which is effective.

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?

With 13 parameters and no output schema, the description covers usage, formats, and modes thoroughly. The example provides a concrete workflow, making it complete enough for most use cases.

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

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, and the description goes beyond by explaining format options, type codes, and the role of parameters like user_message, session_tokens, and mode. This adds significant context.

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: to analyze user messages and retrieve token-efficient context before every AI response. It distinguishes itself from siblings by emphasizing its role in replacing full chat history.

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?

The description explicitly directs 'CALL THIS BEFORE EVERY AI RESPONSE', providing a clear usage guideline. It also explains format and mode options, and gives an example workflow, though it doesn't mention when not to use it.

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