Skip to main content
Glama

Get File Info

stat
Read-only

Retrieve file metadata including type, size, timestamps, permissions, MIME type, and symlink target, and verify path existence without reading file contents.

Instructions

Get metadata without reading contents, like ls -ld: type, size (a directory reports its own entry, not its contents), tokenEstimate, timestamps, permissions, MIME type guessed from the extension, and symlink target. Also checks whether paths exist.

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.2/5.0
Behavior4/5

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

The description adds meaningful behavioral details beyond the readOnlyHint annotation: directory size refers to the directory entry itself, MIME type is guessed from extension, and symlink target is included. This sets correct expectations for stat semantics that a generic read-only hint does not convey. There is no contradiction with 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?

The description is compact and front-loaded: the core purpose appears in the first few words, followed by a useful ls -ld analogy and a tight list of returned fields. The final existence-check sentence earns its place by clarifying behavior on missing paths. There is no filler.

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 two-parameter metadata tool with no output schema, the description covers the key return fields, directory behavior, and existence checking. It does not specify the exact output structure or error behavior, but the field list is sufficient for an agent to invoke stat correctly and interpret results.

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?

Both parameters are fully described in the input schema, so the description does not need to add parameter-level semantics. The metadata list applies to both path and paths modes but does not enrich the schema's already clear descriptions. A baseline of 3 is appropriate given the high schema coverage.

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 opens with a specific action ('Get metadata without reading contents') and names the exact resource (path(s)) plus the metadata fields returned. It clearly distinguishes itself from read/list siblings by emphasizing that it does not read file contents. This is unambiguous and immediately actionable.

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 description clearly indicates this tool is for metadata retrieval, not content access, and adds that it checks whether paths exist. It does not explicitly name sibling alternatives or state when not to use it, so the agent must infer the choice from the 'without reading contents' contrast. That is clear context but not an explicit exclusion.

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