Skip to main content
Glama

files/filetype

Read-onlyIdempotent

Return a file's MIME type from its leading bytes so you can identify its format and handle text versus binary appropriately.

Instructions

Returns a file's MIME type, like file -b --mime-type, detected natively from its first 8 KiB (no file(1) needed); read-only, path must be absolute. A symlink is reported as inode/symlink (never followed); directories, devices, fifos and sockets as inode/.... Use it before files/read, which refuses binary files. For size, permissions or ownership use files/list; for contents files/read. The reply is always one plain-text line (no output_format). privileged: true (a grant, and for root a paths: entry) reads files your account cannot.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to the file
privilegedNoRun as root. Needs a grant for this tool in mcp-sudo.yaml and a `paths:` entry covering the path, otherwise refused

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.4.1
    • changedInput schema / properties / privileged / description
      Previous value: -"Set to true to run as root"New value: +"Run as root. Needs a grant for this tool in mcp-sudo.yaml and a `paths:` entry covering the path, otherwise refused"
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations: it discloses that symlinks are never followed (reported as inode/symlink), that directories/devices/fifos/sockets report as inode/..., the 8 KiB detection window, and that privileged mode requires a grant plus a `paths:` entry or is refused. It also states the reply shape (one plain-text line, no output_format).

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?

Front-loaded with the core behavior and organized by purpose, alternatives, and return format. It is densely packed with semicolon-chained clauses, but virtually every clause carries distinct information, so little is wasted.

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 compensates by stating the return format ('always one plain-text line, no output_format'). Combined with the symlink/special-file behavior and privileged prerequisites, an agent has everything needed to call it 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?

Schema coverage is 100% and both parameter descriptions already state 'absolute path' and the privileged grant/paths requirement, so the description largely restates what the schema provides. The added 'otherwise refused' phrasing is marginal value, so the 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+resource ('Returns a file's MIME type') plus the exact detection mechanism ('like `file -b --mime-type`, detected natively from its first 8 KiB'). It explicitly differentiates from siblings by naming files/read and files/list and what each is for.

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?

Gives an explicit trigger ('Use it before `files/read`, which refuses binary files') and routes the other use cases away to named alternatives: files/list for size/permissions/ownership, files/read for contents. Nothing is left to inference.

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