Skip to main content
Glama

prepare_context

Read-only

Build one task-specific, token-budgeted context pack from relevant workspace pages. Ranks lexical matches, prefers human-reviewed OKF knowledge, penalizes stale/deprecated concepts, and adds the top result's link-graph neighbors. Use this before multi-page product or coding work instead of many search/get_page calls.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskYesThe concrete task or question to gather context for
maxTokensNoApproximate maximum tokens in the returned JSON
maxConceptsNoMaximum page concepts to include
trustPolicyNoprefer-human-reviewed
includeRelatedNoInclude title/id references from the top concept's graph neighborhood

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskYes
policyYes
profileYes
relatedYes
conceptsYes
handlingYes
warningsYes
expiresAtNo
retrievalYes
truncatedYes
budgetTokensYes
contextRunIdNo
estimatedTokensYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

Annotations provide readOnlyHint=true and openWorldHint=false, but the description adds valuable behavioral context: it ranks lexical matches, prefers human-reviewed OKF knowledge, penalizes stale/deprecated concepts, and adds link-graph neighbors. This goes beyond the annotations without contradicting them.

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?

Two sentences with no filler. The main action is front-loaded ('Build one task-specific, token-budgeted context pack'), followed by concise behavioral details and a usage directive. Every sentence earns its place.

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?

The tool is complex with 5 parameters and an output schema. The description explains the core behavior (ranking, preference, link-graph) and usage context, which is sufficient for an agent to decide when to call it. Output structure is left to the schema, which is acceptable. Minor gap: doesn't describe the exact format of the returned context pack, but that's covered by the output schema.

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 80% (4 of 5 params described), so baseline is 3. The description mentions 'prefers human-reviewed OKF knowledge' which hints at trustPolicy, but it doesn't elaborate on parameter syntax or usage beyond what the schema already specifies. No significant additional meaning is added.

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 states a specific verb 'Build' with a resource 'task-specific, token-budgeted context pack from relevant workspace pages' and details the ranking/preference behavior. It clearly distinguishes itself from siblings like search_workspace or get_pages by focusing on aggregating context rather than returning raw pages.

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?

Explicitly says 'Use this before multi-page product or coding work instead of many search/get_page calls', giving a clear when-to-use and naming the alternative pattern it replaces. Lacks an explicit when-not-to-use but the 'instead of many' implies it's not for single-page lookups.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.