Skip to main content
Glama

file_context

Retrieve known errors, decisions, open tasks, and preferences tied to a file path before editing it, so you can avoid repeating mistakes and respect prior project context.

Instructions

Before editing a file, ask what is known about it: fixed errors, decisions, open tasks and preferences that mention this file path. Pass an absolute or relative path.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>"
    },
    "name": "file_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesFile path, e.g. src/engine/http.ts
limitNoMaximum number of results
projectNoOptional — limit to one project (path or name)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.16.1
    • addedInput schema / properties / limit / description
      Added value: +"Maximum number of results"
  2. First observed

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully discloses what the results contain (errors, decisions, tasks, preferences) and implies a read-only lookup, but says nothing about ordering, whether the limit truncates by relevance or recency, or permissions.

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?

Two short sentences with the usage trigger front-loaded and no filler. The second sentence's path guidance is minor but not wasteful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Adequate for a simple three-parameter lookup with no output schema: purpose, trigger, result content and path format are covered. It still leaves unaddressed how results are ordered or bounded and how this differs from the context/memory siblings.

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 coverage is 100%, so the schema already documents path, limit and project. The description adds only the note that the path may be absolute or relative; it does not explain the limit default of 8 or how project scoping interacts with a path argument.

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 names the resource (knowledge about a specific file path) and enumerates the kinds of records returned: fixed errors, decisions, open tasks and preferences. It does not name a sibling tool to distinguish itself from, so it lands just short of a 5.

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?

"Before editing a file" is a clear, actionable trigger condition for when to use this tool. There are no exclusions or named alternatives (e.g., when project_context or get_memory would be the better choice), which keeps it from a 5.

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