Skip to main content
Glama

khwan_prepare

Retrieve memory-enriched context before answering a message. Get coherence-gated permission and a turn token to pass when recording your response.

Instructions

Pull the memory-enriched context for a turn BEFORE you answer.

Khwan builds context from memory + the brain's constitution + a coherence gate. No model is called. Ground your reply in the returned context and respect allowed/reason. Keep the returned turn_token and pass it to khwan_record after you answer.

Args: input: The user's message / the turn you are about to answer.

Returns: context: ready-to-use messages (memory + constitution) to ground your reply. coherence: optional float — how coherent this turn is with the brain (may be None). allowed: whether Khwan's coherence gate permits answering. reason: why, when not allowed (else None). turn_token: opaque token — pass it verbatim to khwan_record.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

The description discloses a crucial behavioral trait: 'No model is called.' It also explains the exact output types (context, coherence, allowed, etc.), shows how the coherence gate works, and clarifies that turn_token is opaque and must be passed verbatim. This is far beyond the input schema and greatly helps an agent form correct expectations.

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?

The description is tightly structured and front-loaded: the command phrase appears first, followed by a brief explanation, then consise Args/Returns lists. There is no redundant prose or restatement of the tool name.

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

Completeness5/5

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

For a tool that has no output schema, the description fully defines the request input, the returned fields, how to react to allowed/reason, and how to continue into khwan_record. The agent has everything it needs to call and integrate the result correctly.

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?

The input schema contains only a required field named 'input', with no description; the description expands it to 'the user's message / the turn you are about to answer', resolving ambiguity. The Returns section is also effectively a response contract, though not technically a parameter description. For a single-parameter tool, semantics are well covered.

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?

Description starts by stating an explicit action ('Pull') and exact timing ('BEFORE you answer') and names the core resources (memory-enriched context). It clearly separates this tool from khwan_record by establishing a prepare/record workflow, so the agent cannot confuse it with siblings.

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 gives direct, actionable usage: call before answering, ground the reply in context, respect allowed/reason, and pass turn_token to khwan_record afterward. It does not enumerate alternative conditions for khwan_memory or khwan_cores versus khwan_prepare, but the workflow ordering is explicit enough.

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/khwanlabs/khwan-mcp'

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