Skip to main content
Glama

Get File Info

get_file_info
Read-onlyIdempotent

Retrieve metadata for a file or directory, including size, timestamps, permissions, type, and hard-link count, without reading its content; access is limited to allowed directories.

Instructions

Retrieve detailed metadata about a file or directory. Returns comprehensive information including size, creation time, last modified time, permissions, type and hard-link count. This tool is perfect for understanding file characteristics without reading the actual content. Only works within allowed directories.

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": "get_file_info"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesThe file or directory to describe. Absolute, or relative to an allowed directory; it must resolve inside the allowed directories.

Output Schema

NameRequiredDescriptionDefault
contentYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds the meaningful operational constraint 'Only works within allowed directories,' though that constraint is also stated in the path parameter schema, which limits the incremental value.

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?

Three sentences, front-loaded with the purpose and the field list. The middle sentence ('This tool is perfect for...') has a marketing tone but does carry the routing signal, so little is wasted.

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?

With rich annotations, a documented single parameter, and an output schema covering return values, the description covers almost everything an agent needs. Minor gaps remain on error behavior for nonexistent paths and symlink handling, and the field enumeration partly duplicates the output schema.

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?

There is a single parameter and schema description coverage is 100%, so the schema already explains that path must resolve inside allowed directories. The description adds no syntax, format, or edge-case guidance (relative vs. absolute resolution, symlinks) beyond what the schema provides, so baseline 3 applies.

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?

States a specific verb and resource ('Retrieve detailed metadata about a file or directory') and enumerates the returned fields. It also explicitly separates itself from the read_* siblings by noting it works 'without reading the actual content,' so an agent can distinguish it without opening a schema.

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?

The phrase 'perfect for understanding file characteristics without reading the actual content' gives a clear selection criterion that implies when to prefer this over read_file/read_text_file. It stops short of naming an alternative or stating exclusions explicitly, so it falls short of a 5.

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