Skip to main content
Glama

Crypto, web, finance and app data tools

File Type Detector

file_type

Detect a file's real format from its first bytes (magic numbers), given as base64 or hex: MIME type, extension and a warning when it does not match the file name. Use to validate uploads.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "data": "<data>"
    },
    "name": "file_type"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataYes
encodingNobase64
filenameNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

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 does the work: it discloses the detection mechanism (first bytes/magic numbers), that output includes a mismatch warning against the file name, and that input must be base64 or hex. It is a pure, non-destructive computation, so nothing about permissions or irreversibility needs stating; only limits such as how many bytes are needed are unaddressed.

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?

A single dense sentence that front-loads the action and mechanism, then the outputs, then the use case. No filler and nothing buried.

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?

An output schema exists, so return values need no elaboration, and the description still flags the key output nuance (mismatch warning). For a three-parameter, read-only tool this is nearly complete; only input-size expectations and the filename-vs-detected-format interaction edge cases are missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate, and it largely does: 'given as base64 or hex' supplies the allowed values for the otherwise enum-less encoding parameter, and the mismatch-warning behavior explains the purpose of filename. The link from these clauses to the actual parameter names is implicit rather than explicit, and the minimum data length is unstated.

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 (detect) and object (a file's real format) plus the mechanism (magic numbers in the first bytes), and enumerates the outputs: MIME type, extension, and a filename-mismatch warning. It is unmistakable against siblings like json_tools, encode_decode, or hash_text.

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?

'Use to validate uploads' gives a concrete selection context, so an agent knows when this tool applies and not, say, encode_decode. It stops short of naming alternatives or stating when not to use it, which keeps it below a 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources