Skip to main content
Glama

Get file info

get_file_info
Read-only

Check whether a workspace-relative path exists and return its kind, size, and modification time; use missing_ok=true to probe absence without failing the call.

Instructions

Return kind, size and modification time of a path. missing_ok=true answers ok with data.exists:false for a missing path instead of not_found (works inside read_batch items too). Use when: you need to know whether a path exists or how big it is. Use missing_ok=true to probe existence without failing the call or the batch. Avoid when: you need the content (read_file). Output: kind, size_bytes, modified_unix_seconds, exists when missing_ok=true. Missing path gives not_found (or ok with exists:false and missing_ok=true).

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": {
      "relative_path": "<relative_path>"
    },
    "name": "get_file_info"
  }
}

Input Schema

NameRequiredDescriptionDefault
missing_okNotrue = answer ok with exists:false for a missing path instead of not_found (default false).
relative_pathYesWorkspace-relative ('.' = root); absolute/.. outside it rejected.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv4.5.0
    • removedInput schema / properties / missing_ok / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "maximum": 1,
      -    "minimum": 0,
      -    "type": "integer"
      -  }
      -]
    • changedInput schema / properties / missing_ok / description
      Previous value: -"1 = answer ok with exists:false for a missing path instead of not_found (default 0)."New value: +"true = answer ok with exists:false for a missing path instead of not_found (default false)."
    • removedInput schema / properties / missing_ok / maximum
      Removed value: -1
    • removedInput schema / properties / missing_ok / minimum
      Removed value: -0
    • changedInput schema / properties / missing_ok / type
      Previous value: -"integer"New value: +"boolean"
  2. Changed1 schema field changedv4.2.0
    • addedInput schema / properties / missing_ok
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "maximum": 1,
      +      "minimum": 0,
      +      "type": "integer"
      +    }
      +  ],
      +  "description": "1 = answer ok with exists:false for a missing path instead of not_found (default 0).",
      +  "maximum": 1,
      +  "minimum": 0,
      +  "type": "integer"
      +}
  3. Addedv4.0.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare readOnlyHint and openWorldHint, so the description carries the error semantics: a missing path yields not_found by default, or ok with exists:false under missing_ok=true, and this behavior propagates inside read_batch items. That batch interaction and the failure mode are meaningful behavioral facts an agent cannot derive from the annotations alone.

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?

The Use when / Avoid when / Output structure is front-loaded and easy to scan, with no wasted framing. There is mild redundancy in explaining missing_ok once in the opening and again in the usage line, which slightly exceeds what is needed.

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?

With no output schema, the description covers the return fields (kind, size_bytes, modified_unix_seconds, exists), the failure mode, and the batch interaction. For a two-parameter read-only tool, nothing an agent needs to call it correctly is missing.

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?

Schema coverage is 100%, so both parameters are already documented and the baseline is 3. The description still contributes beyond the schema by noting that missing_ok also works inside read_batch items, which the schema description does not mention, though it otherwise restates the default-false semantics.

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?

Opens with a specific verb and the exact resource set returned (kind, size, modification time of a path), which tells an agent precisely what it gets. It also implicitly separates itself from content-reading siblings, and the 'Avoid when' line makes the distinction to read_file explicit.

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?

Provides an explicit 'Use when' condition (checking existence or size), an explicit 'Avoid when' pointing to the named alternative read_file for content, and a further rule for when to set missing_ok=true. This is the when/when-not/alternative pattern in full.

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