Skip to main content
Glama

files/filetype

Identify a file's MIME type by inspecting its first bytes without relying on the file command. Reports symlinks as inode/symlink; use stat for size or permissions.

Instructions

Determines a file's MIME type - the answer file -b --mime-type gives, detected natively from the file's first bytes (no file(1) needed). A symlink is reported as inode/symlink, not followed. Use files/stat for size/permissions/ownership instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to the file
privilegedNoSet to true to run as root

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It does this well by describing how the MIME type is detected (from the first bytes, natively, without file(1)) and by documenting the symlink edge case ('reported as inode/symlink, not followed'). It does not state permission requirements or lack of side effects, but for a read-only lookup these are minor omissions.

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?

Two tightly written sentences with no filler. The core purpose is front-loaded, followed by a valuable behavioral caveat, and then a useful pointer to an alternative. Every clause 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 simple MIME-type tool with no output schema, the description is nearly complete: it explains the operation, the symlink behavior, and how it differs from the stat alternative. It does not describe the exact return format or error behavior, but the `file -b --mime-type` analogy sufficiently implies a MIME-type string output. Minor gaps keep it from a 5.

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 baseline is 3. The description adds little parameter-specific meaning beyond the schema: it clarifies that the path is to a file and mentions symlink behavior, but does not elaborate on `privileged`. The schema already documents 'path' and 'privileged' adequately, so no penalty or bonus is warranted.

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 uses a specific verb and resource: 'Determines a file's MIME type'. It further distinguishes itself from the file/stat sibling by explicitly stating that stat is for size/permissions/ownership. The analogy to `file -b --mime-type` makes the purpose instantly recognizable.

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 gives clear routing guidance: 'Use files/stat for size/permissions/ownership instead.' This explicitly states an alternative and the condition under which that alternative should be chosen, so an agent knows exactly when to select this tool over the most likely sibling.

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