Skip to main content
Glama

statewave_get_context

Retrieve a compact, ranked context bundle of distilled facts and procedures for a subject, tailored to your task. Replaces raw chat history or full files with only the most relevant information for LLM prompts.

Instructions

Assemble a compact, ranked context bundle for a subject, tailored to the task described in query. Read-only. Designed to be injected into an agent/LLM prompt in place of stuffing raw chat history or whole files: it returns only the most relevant distilled facts and procedures, fit to a token budget. Returns a context bundle with assembled_context (ready-to-prompt text), structured facts and procedures arrays, and a token estimate. Prefer this over statewave_search_memories when you want prompt-ready context rather than a raw ranked list of memories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe task being performed or question being answered. Used to rank and select which facts and procedures to include in the bundle.
subjectYesSubject to retrieve context for. Format `scope:identifier`, e.g. `repo:owner.name` or `customer:acme`.
max_tokensNoApproximate token budget for the assembled context (100–32000, default 2000). Lower it for tight prompts; raise it for richer context.
Behavior4/5

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

With no annotations, the description carries full burden. It declares read-only behavior and describes the output structure (assembled_context, facts, procedures, token estimate). It does not cover auth needs or error handling but provides sufficient behavioral context for an agent.

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 a single paragraph but is concise and front-loaded with purpose. Every sentence serves a purpose, though it could be broken into shorter sentences for clarity.

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 (3 params, no output schema, no annotations), the description explains purpose, usage, output, and parameter details adequately. It lacks edge-case or error information but is generally complete.

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%, and the description adds meaning beyond the schema: it explains query's ranking role, subject's format with examples, and max_tokens usage advice. This adds substantial value.

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 assembles a compact, ranked context bundle for a subject tailored to the query. It uses specific verbs ('assemble', 'injected') and distinguishes itself from statewave_search_memories, making the purpose unambiguous.

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?

The description explicitly recommends preferring this tool over statewave_search_memories when prompt-ready context is needed, providing a clear when-to-use scenario. However, it does not address when to use other siblings like statewave_compile_subject or statewave_get_timeline.

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/smaramwbc/statewave-connectors'

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