Skip to main content
Glama

Get File Info

stat
Read-only

Retrieve file or directory metadata—size, type, permissions, MIME type, timestamps, and token estimate. Use the token estimate to pre-screen read cost before reading.

Instructions

Get metadata for one or more files or directories: size, type, permissions, MIME type, timestamps, and tokenEstimate. Use tokenEstimate to pre-screen read cost before calling read. Single path: pass path. Batch mode: pass paths[].

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoSingle file path; mutually exclusive with paths
pathsNoArray of file paths for batch mode (max 1000); mutually exclusive with path

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.4.1
    • addedInput schema / $schema
      Added value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed6 schema fields changedv2.0.0
    • removedInput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / oneOf
      Added value: +[
      +  {
      +    "required": [
      +      "path"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "paths"
      +    ]
      +  }
      +]
    • changedInput schema / properties / path / description
      Previous value: -"Absolute path to file or directory."New value: +"Single file path; mutually exclusive with paths"
    • addedInput schema / properties / paths
      Added value: +{
      +  "description": "Array of file paths for batch mode (max 1000); mutually exclusive with path",
      +  "items": {
      +    "description": "File or directory path inside an allowed workspace root.",
      +    "maxLength": 4096,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  "maxItems": 1000,
      +  "minItems": 1,
      +  "type": "array"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "path"
      -]
    • changedOutput schema / (root)
      Previous value: -{
      -  "$schema": "https://json-schema.org/draft/2020-12/schema",
      -  "additionalProperties": false,
      -  "properties": {
      -    "info": {
      -      "additionalProperties": false,
      -      "properties": {
      -        "accessed": {
      -          "description": "Accessed",
      -          "format": "date-time",
      -          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
      -          "type": "string"
      -        },
      -        "created": {
      -          "description": "Created",
      -          "format": "date-time",
      -          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
      -          "type": "string"
      -        },
      -        "isHidden": {
      -          "description": "Hidden?",
      -          "type": "boolean"
      -        },
      -        "mimeType": {
      -          "description": "MIME type",
      -          "type": "string"
      -        },
      -        "modified": {
      -          "description": "Modified",
      -          "format": "date-time",
      -          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
      -          "type": "string"
      -        },
      -        "name": {
      -          "description": "Name",
      -          "type": "string"
      -        },
      -        "path": {
      -          "description": "Absolute path",
      -          "type": "string"
      -        },
      -        "permissions": {
      -          "description": "Permissions",
      -          "type": "string"
      -        },
      -        "size": {
      -          "description": "Size (bytes)",
      -          "maximum": 9007199254740991,
      -          "minimum": 0,
      -          "type": "integer"
      -        },
      -        "symlinkTarget": {
      -          "description": "Target (symlink)",
      -          "type": "string"
      -        },
      -        "tokenEstimate": {
      -          "description": "Est. tokens (size/4)",
      -          "maximum": 9007199254740991,
      -          "minimum": 0,
      -          "type": "integer"
      -        },
      -        "type": {
      -          "description": "Type",
      -          "enum": [
      -            "file",
      -            "directory",
      -            "symlink",
      -            "other"
      -          ],
      -          "type": "string"
      -        }
      -      },
      -      "required": [
      -        "name",
      -        "path",
      -        "type",
      -        "size",
      -        "created",
      -        "modified",
      -        "accessed",
      -        "permissions",
      -        "isHidden"
      -      ],
      -      "type": "object"
      -    },
      -    "ok": {
      -      "const": true,
      -      "type": "boolean"
      -    }
      -  },
      -  "required": [
      -    "ok"
      -  ],
      -  "type": "object"
      -}New value: +null
  3. Addedv1.15.3
  4. Removedv1.15.0
  5. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, so the agent knows this is a safe read operation. The description adds value by disclosing that the tool returns tokenEstimate, which is a behavioral detail beyond the schema, and by explaining that it can operate in batch mode on up to 1000 paths. It doesn't describe error behavior or permission requirements, but for a read-only metadata tool with readOnlyHint=true, the description covers the key behavioral aspects.

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?

Three sentences with zero waste. The core purpose and return fields are front-loaded, the usage guidance is concise, and the two invocation modes are stated in a compact, scannable format. Every sentence earns its place.

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?

For a read-only metadata tool with 100% schema coverage and readOnlyHint=true, the description is nearly complete. It covers what the tool returns, when to use it, and how to invoke it in both modes. The only minor gap is that it doesn't describe the output structure or error behavior, but since there's no output schema and the tool is simple, this is a small omission rather than a critical one.

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 description coverage is 100%, so the schema already documents both parameters (path and paths) including their mutual exclusivity and constraints. The description adds the semantic context that path is for single-file mode and paths is for batch mode, which is helpful but largely mirrors what the schema already states. Baseline 3 is appropriate since the schema does the heavy lifting.

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 states a specific verb ('Get metadata') and resource ('one or more files or directories'), and enumerates the exact metadata fields returned: size, type, permissions, MIME type, timestamps, and tokenEstimate. This clearly distinguishes it from sibling tools like read, list, and find_files, which have different purposes.

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 explicitly tells the agent when to use this tool: 'Use tokenEstimate to pre-screen read cost before calling read.' This is a clear usage directive that positions stat as a precursor to read. It also explains the two invocation modes (single path vs batch paths), which is practical guidance for choosing how to call it.

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