Skip to main content
Glama

ctx_context

Builds a compact, relevance-ranked JSON context package for a coding task. Give a natural-language task to retrieve relevant files, symbols, and snippets for an LLM, with optional git changes.

Instructions

Build a compact, relevance-ranked context package for a coding task and return it as JSON. This is the high-value tool: give it a natural-language task and it returns the most relevant files/symbols/snippets to feed to an LLM, optionally including recent git changes. Use when you need a focused slice of the codebase for a prompt instead of reading many files. task is required and should describe the goal; include_bodies (default false) embeds function bodies; max_tokens (default auto, 128-100000) caps package size.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskYesNatural-language description of the coding task the context should support. Required.
max_tokensNoUpper bound on package size in tokens. Omit for automatic sizing.
include_bodiesNoWhen true, include function/body text in the package (larger output). Default false.
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure, and it provides meaningful details: output is JSON, results are relevance-ranked, recent git changes can be included, include_bodies embeds function bodies, and max_tokens caps package size. This goes well beyond what the schema alone states, though it does not address potential costs, errors, or side effects.

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 concise and front-loaded, with the core purpose stated in the first sentence. The second sentence adds functional emphasis and usage context, and the third compacts parameter guidance efficiently. The phrase 'This is the high-value tool' is promotional but not harmful, and overall the description is well-structured and free of redundancy.

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 description gives the agent enough to invoke the tool correctly: a required natural-language task, optional body inclusion, token capping, and a JSON output of files/symbols/snippets. With no output schema, a little more detail about the exact output structure would improve completeness, but the description covers the essential invocation contract.

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?

The input schema already has 100% description coverage for all three parameters, so the schema does the heavy lifting. The description adds useful default information ('include_bodies default false', 'max_tokens default auto') and clarifies each parameter's role, but this is supplemental rather than necessary for understanding the parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: 'Build a compact, relevance-ranked context package... and return it as JSON.' It clearly describes what the tool does and what the agent can expect from it. However, it does not explicitly distinguish this tool from its many sibling tools like ctx_symbol, ctx_skeleton, or ctx_search, so differentiation is left mostly implicit.

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 a clear usage context: 'Use when you need a focused slice of the codebase for a prompt instead of reading many files.' This tells the agent when the tool is appropriate, but it does not mention when not to use it or name alternative sibling tools. The guidance is useful but lacks explicit exclusions.

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/halloffame12/CTX'

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