Skip to main content
Glama

Get File Info

stat
Read-only

Retrieve file or directory metadata without reading contents—type, size, timestamps, permissions, MIME type, symlink target—and check which paths exist.

Instructions

Get metadata without reading contents, like ls -ld: type, size (files) or entryCount (directories; secret files not counted), tokenEstimate, timestamps, permissions (readOnly on Windows), MIME type guessed from the extension, and symlink target. Also checks whether paths exist: each missing path gets its own NOT_FOUND entry.

Input 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.9.1
    • removedInput schema / oneOf
      Removed value: -[
      -  {
      -    "required": [
      -      "path"
      -    ]
      -  },
      -  {
      -    "required": [
      -      "paths"
      -    ]
      -  }
      -]
  2. Changed1 schema field changedv2.4.1
    • addedInput schema / $schema
      Added value: +"https://json-schema.org/draft/2020-12/schema"
  3. 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
  4. Addedv1.15.3
  5. Removedv1.15.0
  6. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses relevant behavior: no content reads, secret files excluded from directory entry counts, Windows-specific readOnly behavior, MIME type guessed from extension, symlink target reporting, and per-path NOT_FOUND entries. This is substantive operational context for an agent.

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?

The description is front-loaded with the core operation and then efficiently packs the relevant metadata fields and existence-check behavior into two sentences. There is no filler; every clause adds useful scope or behavior.

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?

There is no output schema, so the description carries the return-value burden and it does so by enumerating key metadata fields and NOT_FOUND behavior. Combined with the readOnly annotation and complete schema documentation, this is sufficient for calling the tool correctly.

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?

With 100% schema description coverage, the schema already documents the single-path and batch-path parameters and their mutual exclusivity. The description adds only general references to 'paths' and missing-path entries, without parameter-specific syntax or rules beyond what the schema provides.

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 operation: retrieve path metadata without reading file contents, explicitly contrasting with content-reading tools. It enumerates the metadata returned and mentions directory entry counts and existence checks, making it clear how this differs from read/list-style siblings.

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?

It gives clear usage context: use this for metadata and existence checks rather than reading contents. However, it does not explicitly name alternative sibling tools or state when-not to use it beyond the implied contrast with reading contents.

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