Skip to main content
Glama

read_file_by_path

Fetch file content by exact absolute path when no file ID is available. Returns an error for unindexed files, with no symlink resolution.

Instructions

Look up a file by its absolute on-disk path and return the same shape as read_file. The path must EXACTLY match what Kontexta indexed — no symlink resolution, no path normalisation beyond what the OS does, no trailing-slash tolerance. Returns isError if no row matches (the file may exist on disk but not be indexed — try refresh_index). Read-only; no side effects, auth, or rate limits. Use when an agent has a path from its working directory but no file ID; if you have the ID, prefer read_file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path on disk (must match the path stored in Kontexta)
Behavior5/5

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

Despite the absence of annotations, the description discloses the read-only nature with 'no side effects, auth, or rate limits', details the strict path-matching behavior ('no symlink resolution, no path normalisation beyond what the OS does, no trailing-slash tolerance'), and specifies failure semantics ('Returns isError if no row matches'). This fully compensates for missing annotations.

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?

Each of the four sentences serves a distinct purpose: defining the operation, specifying path constraints, stating error behavior, and giving usage guidance with alternatives. There's no redundancy or filler.

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?

For a simple single-parameter read tool with no output schema, the description covers its purpose, output shape (via reference to `read_file`), error handling, path requirements, and usage context. It also addresses the edge case of unindexed files. This is a complete and self-sufficient description.

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?

The schema's `path` description only states it must be an absolute path matching storage. The tool description adds critical operational semantics: the path must match exactly as indexed, with no symlink resolution or normalization and no trailing-slash tolerance. This is a substantial enrichment over the schema, though it stops short of providing format specifications or examples.

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 tool's description opens with a clear action: 'Look up a file by its absolute on-disk path' and explicitly ties the output to `read_file`. It differentiates itself from the closely related `read_file` by emphasizing path-based lookup versus ID-based lookup and states a preference: 'if you have the ID, prefer read_file'. This is specific and unambiguous.

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?

The description gives explicit when-to-use guidance: 'Use when an agent has a path from its working directory but no file ID' and contrasts with `read_file` when an ID is available. It also suggests a fallback when the file is not found: 'try refresh_index'.

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/safiyu/kontexta'

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