v0.4.x uses ~11 consolidated domain tools for ~75% token reduction vs previous versions. Rules Version: 0.4.27
| Message | What to Call |
|---|---|
| 1st message | session_init(folder_path="<cwd>", context_hint="<user_message>"), then context_smart(user_message="<user_message>", format="minified", max_tokens=400) |
| 2nd+ messages | context_smart(user_message="<user_message>", format="minified", max_tokens=400) |
| Capture decisions | session(action="capture", event_type="decision", title="...", content="...") |
| Before risky work | session(action="get_lessons", query="<topic>") |
| On user frustration | session(action="capture_lesson", title="...", trigger="...", impact="...", prevention="...") |
Context Pack (Pro+): If enabled, use context_smart(..., mode="pack", distill=true) for code/file queries. If unavailable or disabled, omit mode and proceed with standard context_smart (the API will fall back).
Tool naming: Use the exact tool names exposed by your MCP client. Claude Code typically uses mcp__<server>__<tool> where <server> matches your MCP config (often contextstream). If a tool call fails with "No such tool available", refresh rules and match the tool list.
| Tool | Common Usage |
|---|---|
search |
search(mode="semantic", query="...", limit=3) — modes: semantic, hybrid, keyword, pattern |
session |
session(action="capture", ...) — actions: capture, capture_lesson, get_lessons, recall, remember, user_context, summary, compress, delta, smart_search |
memory |
memory(action="list_events", ...) — CRUD for events/nodes, search, decisions, timeline, summary |
graph |
graph(action="dependencies", ...) — dependencies, impact, call_path, related, ingest |
project |
project(action="list", ...) - list, get, create, update, index, overview, statistics, files, index_status, ingest_local |
workspace |
workspace(action="list", ...) — list, get, associate, bootstrap |
integration |
integration(provider="github", action="search", ...) — GitHub/Slack integration |
help |
help(action="tools") — tools, auth, version, editor_rules |
search(mode="hybrid") FIRST. Use local tools ONLY if ContextStream returns 0 results.
- First message: Call
session_initwith context_hint, then callcontext_smartbefore any other tool or response - On [INGEST_RECOMMENDED]: Ask the user if they want to enable semantic code search. Explain: "Indexing your codebase enables AI-powered code search, dependency analysis, and better context. This takes a few minutes." If user agrees, run the provided
project(action="ingest_local")command. - Every message after: Always call
context_smartBEFORE responding (semantic search for relevant context) - Before searching files/code: Check
project(action="index_status"); if missing/stale runproject(action="ingest_local", path="<cwd>")orproject(action="index"), and usegraph(action="ingest")if needed - For discovery: Use
session(action="smart_search")orsearch(mode="hybrid")— NEVER use local Glob/Grep/Read first - For file/function/config lookups: Use
search/graphfirst; only fall back to rg/ls/find if ContextStream returns no results - If ContextStream returns results: Do NOT use local Search/Explore/Read; only open specific files when needed for exact edits
- For code analysis: Use
graph(action="dependencies")orgraph(action="impact")for call/dependency analysis - On [RULES_NOTICE]: Use
generate_rules()to update rules - After completing work: Always capture decisions/insights with
session(action="capture") - On mistakes/corrections: Immediately capture lessons with
session(action="capture_lesson")
When user asks to create a plan or implementation roadmap:
- Create plan:
session(action="capture_plan", title="Plan Title", description="...", goals=["goal1", "goal2"], steps=[{id: "1", title: "Step 1", order: 1}, ...]) - Get plan_id from response, then create tasks:
memory(action="create_task", title="Task Title", plan_id="<plan_id>", priority="high|medium|low", description="...")
To manage existing plans/tasks:
- List plans:
session(action="list_plans") - Get plan with tasks:
session(action="get_plan", plan_id="<uuid>", include_tasks=true) - List tasks:
memory(action="list_tasks", plan_id="<uuid>")ormemory(action="list_tasks")for all - Update task status:
memory(action="update_task", task_id="<uuid>", task_status="pending|in_progress|completed|blocked") - Link task to plan:
memory(action="update_task", task_id="<uuid>", plan_id="<plan_uuid>") - Unlink task from plan:
memory(action="update_task", task_id="<uuid>", plan_id=null) - Delete:
memory(action="delete_task", task_id="<uuid>")ormemory(action="delete_event", event_id="<plan_uuid>")
Full docs: https://contextstream.io/docs/mcp/tools