get_context_for_prompt
Retrieves relevant codebase context including file summaries, code snippets, related files, and past session memories to understand features, prepare for changes, and explore unfamiliar code.
Instructions
Get relevant codebase context optimized for prompt enhancement. This is the primary tool for understanding code and gathering context before making changes.
Returns:
File summaries and relevance scores
Smart-extracted code snippets (most relevant parts)
Related file suggestions for dependency awareness
Relevant memories from previous sessions (preferences, decisions, facts)
Token-aware output (respects context window limits)
Use this tool when you need to:
Understand how a feature is implemented
Find relevant code before making changes
Get context about a specific concept or pattern
Explore unfamiliar parts of the codebase
Recall user preferences and past decisions
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Description of what you need context for (e.g., "authentication logic", "database schema", "how user registration works") | |
| max_files | No | Maximum number of files to include (default: 5, max: 20) | |
| token_budget | No | Maximum tokens for the entire context (default: 8000). Adjust based on your context window. | |
| include_related | No | Include related/imported files for better context (default: true) | |
| min_relevance | No | Minimum relevance score (0-1) to include a file (default: 0.3) | |
| bypass_cache | No | Bypass caches (forces fresh retrieval; useful for benchmarking/debugging). |