Skip to main content
Glama

get_file_context

Retrieve file-specific knowledge base context: architecture decisions, bugfix summaries, and best practices ranked by relevance. Use before editing any source file.

Instructions

Retrieve knowledge base context relevant to a specific source file. Read-only.

    Runs multiple semantic searches derived from the filename and returns
    architecture decisions, past bugfixes, and best practices related to
    that file — without requiring a manual search query. No files modified.

    Complements get_recent_sessions() (temporal context) with file-level
    spatial context. Use before reading or editing any source file.
    Use search_docs() for free-form queries not tied to a specific file.

    Args:
        filename: File path or name being opened/edited, e.g.
                  "payment.service.ts" or "src/auth/jwt.py"
        project: Target project name (optional)

    Returns:
        Relevant architecture docs, bugfix summaries, and best practices
        for the given file, ranked by relevance. Returns "no context found"
        when the knowledge base has nothing for that file yet.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYes
projectNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Discloses read-only nature, multiple semantic searches, no file modification, and return of 'no context found' when applicable. With no annotations, description fully covers behavioral traits.

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?

Well-structured with clear sections and front-loaded purpose. Slightly verbose but each sentence adds value. Could be tighter while remaining informative.

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?

Covers retrieval purpose, usage, and return behavior. Mentions output schema existence but doesn't detail structure. Adequate for the tool's simplicity and sibling context.

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?

Although schema description coverage is 0%, the description adds context with usage examples for filename and explains project as optional. Provides enough for an agent to understand parameter roles.

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?

Clearly states it retrieves knowledge base context relevant to a source file. Distinguishes from sibling tools like get_recent_sessions and search_docs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says 'Use before reading or editing any source file.' and directs free-form queries to search_docs. Also mentions complementary relationship with get_recent_sessions.

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/dl4rce/flaiwheel'

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