Skip to main content
Glama

Identify a file type

ai_file_identify
Read-onlyIdempotent

Detect a file’s real type and MIME from content, not its name, and flag extension mismatches. It also reports size, SHA-256, and text encoding to verify file identity safely.

Instructions

Find out what a file really is from its content (magic bytes, via file-type: images, video, audio, archives, Office, PDF, fonts, executables… ~150 formats), not its name. Reports the detected type and MIME, whether the extension disagrees with the content, size, SHA-256, and for text files an encoding guess (UTF-8, UTF-8/16/32 with BOM, UTF-16 without BOM, ASCII, 8-bit legacy) plus a text kind (JSON, XML, SVG, HTML…). Accepts a file path or base64. Nothing is executed.

Input Schema

NameRequiredDescriptionDefault
fileYesThe file to identify: a local file path (absolute, or relative to the server's --root) or base64 data (raw or a data: URI).
nameNoFile name to compare the extension against (handy for base64 input). Default: the path's own name.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations: discloses the underlying library (file-type), the ~150-format coverage, that 'Nothing is executed', and the accepted input forms (path or base64). This is exactly the behavioral context annotations don't carry.

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-loads the core purpose and packs useful detail into a few dense sentences with no filler. Slightly long due to the return-value enumeration, but each clause carries information.

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 fully compensates by enumerating the returned fields (detected type, MIME, mismatch flag, size, SHA-256, encoding and text-kind guess). An agent knows exactly what calling it yields.

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%, so both parameters are already documented. The description reinforces that a path or base64 is accepted and that the extension comparison happens, but adds little syntax or format detail beyond the schema; 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?

Starts with a specific verb and resource ('Find out what a file really is from its content'), scopes it to magic-byte detection across ~150 formats, and explicitly contrasts it with name-based guessing. An agent can distinguish this from siblings like ai_media_info or hash_compute without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'from its content, not its name' framing implies when this is the right tool versus name-based inference, but it never names an alternative (e.g., ai_media_info) or states when NOT to use it. Usage is implied rather than spelled out.

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

Deploy Server

Other Tools