Skip to main content
Glama

get_file_context

Retrieve architecture decisions, bugfix summaries, and best practices for any source file. Use before editing to gain relevant context without manual search.

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
projectNo
filenameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Without annotations, the description fully discloses read-only nature ('No files modified', 'Read-only'), the semantic search process, and return behavior including the 'no context found' case.

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 well-structured with a summary, details, args section, and returns section. Every sentence is meaningful and concise, with no wasted words.

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?

Given the presence of an output schema (mentioned in context signals), the description appropriately explains the return content and edge case, providing sufficient completeness for agent decision-making.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema coverage, the description adds valuable context: filename is explained with examples ('payment.service.ts' or 'src/auth/jwt.py') and project is described as optional target project name.

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 clearly states 'Retrieve knowledge base context relevant to a specific source file' with a specific verb and resource, and explicitly distinguishes from siblings 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?

It explicitly states when to use ('before reading or editing any source file'), when not to use ('Use search_docs() for free-form queries not tied to a specific file'), and names an alternative (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