Skip to main content
Glama
axross-headless-mcp

axross-headless-mcp

Identify file type

identify_file_type
Read-onlyIdempotent

Detects a file's true type from magic bytes and checks whether its extension matches, useful when an extension may lie.

Instructions

Identify one file's real type from its content (magic bytes) and check the extension against it. Use when: an extension may lie, or encoding and line endings matter. Instead: scan_file_types for a folder; get_path_info for size and date. Requires: --mcp-tools filetype. Behavior: read-only; reads at most max_bytes. An unreadable or missing file is a result (kind error); reading gives up after 15 s per file (kind timeout). Refuses secret files. Time limit: 60 s. Returns: {path, name, kind, verdict (match|mismatch|unknown), mismatch, mime, extension, encoding, line_endings, engine, ...}; outputSchema describes each.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "identify_file_type"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoThe file to identify (absolute, or relative to the MCP root). Required unless path_b64 is given.
backendNoBackend id from list_backends; omit for the default.
path_b64Nopath as base64 of its raw bytes, for non-UTF-8 names; replaces path.
max_bytesNoBytes read from the start of the file for the content check (64 KiB default, at most 1 MiB).
use_file_commandNoAlso run the file(1) command for its description (file_command); local regular files only, ignored on remote backends.

Output Schema

NameRequiredDescriptionDefault
kindYesspecial: a FIFO, device or socket (not read); error, timeout, cancelled: not read, error says why and the type fields are empty
mimeNothe content's MIME type; '' when unknown
nameYesits file name
pathYesthe file as asked for
sizeNobytes; null when not known
errorNowhy the type fields are empty; '' when read
engineNowhat decided: 'Qt', 'puremagic', 'signature table', 'text heuristic', 'disk image' or 'size'
verdictYescontent against extension; unknown: no extension claim, or the content cannot tell
encodingNotext only: 'ASCII', 'UTF-8', a BOM's name or a guess; '' for binary
mismatchYesverdict == 'mismatch'
extensionNothe name's extension, e.g. '.png'; '' for none
bytes_readNobytes of content read (at most max_bytes)
descriptionNothe content type in words, e.g. 'PNG image'; '' when unknown
file_commandNofile(1)'s description, local only; '' when unavailable
line_endingsNotext only: 'LF', 'CRLF', 'CR', 'mixed (...)' or 'none'
extension_mimeNothe MIME type the extension claims; '' when it is unknown

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.15.181

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, but the description adds real operational context: the --mcp-tools filetype enablement requirement, the max_bytes read cap, a 15 s per-file read timeout, a 60 s overall time limit, refusal of secret files, and the fact that unreadable files return kind error rather than failing. These are failure modes and constraints an agent cannot get from 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?

Labeled sections (Use when / Instead / Requires / Behavior / Returns) front-load purpose, then routing, then constraints. Every clause carries an actionable fact; nothing is redundant padding.

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?

For a read-only inspection tool with five optional params and an output schema, the description covers enablement, limits, error/timeout semantics and the verdict vocabulary (match|mismatch|unknown). An agent has everything needed to call it and interpret the outcome.

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 path, path_b64, backend, max_bytes and use_file_command are all documented in the schema itself. The description only reinforces max_bytes ('reads at most max_bytes') and says nothing about backend selection or use_file_command, so it adds little beyond the schema baseline.

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 and resource ('Identify one file's real type from its content (magic bytes)') plus the added check ('check the extension against it'). It also scopes to a single file, which cleanly separates it from the folder-level sibling scan_file_types.

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?

Provides an explicit 'Use when' condition (extension may lie, or encoding/line endings matter) and names two alternatives with the reason each exists: scan_file_types for a folder, get_path_info for size and date. Both when-to-use and when-not-to-use are covered.

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