Skip to main content
Glama

Detect format

detect_format
Read-onlyIdempotent

Identify the format of an opaque or unlabelled input—such as JSON, YAML, XML, CSV, base64, JWT, or UUID—and return ranked candidates with confidence scores.

Instructions

Guess what input is — JSON, YAML, TOML, XML, HTML, CSV/TSV, base64/base32/hex, URL-encoding, JWT, UUID, data URI, gzip/zlib, email, URL, IP address, unix timestamp, Markdown, SQL, Morse code, ROT13, plain binary — and return {candidates: [{format, confidence, note}]}, best first, confidence 0-1. Use it when you are handed an opaque or unlabelled value and must pick a utility for it; skip it when the format is already known. It only identifies, never transforms: to decode, search list_utilities for the top format (base64 -> base64_decode, JWT -> jwt_decode) and run that with run_utility. Ambiguous input yields several candidates (all-digit text can be a timestamp, JSON and hex at once); treat anything below about 0.45 as a weak guess. Use inputEncoding "base64"/"hex" only to deliver binary data such as gzip bytes: it is decoded before detection, so a base64 string you want identified must stay "text" (the default). Empty input yields an empty list.

Input Schema

NameRequiredDescriptionDefault
inputYesThe value to inspect.
inputEncodingNoHow to decode `input` first. Default "text".

Output Schema

NameRequiredDescriptionDefault
candidatesYesLikely formats, best first; confidence is 0-1. Empty for empty input.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.8.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), and the description adds real behavior: it never transforms, only identifies; ambiguous input returns multiple candidates; scores below ~0.45 are weak guesses; empty input yields an empty list. The only shortfall is that it says nothing about cost/performance on large inputs, but as a pure read-only classifier that is minor.

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 purpose, then usage, then the decode-vs-run handoff, then the encoding gotcha, then the empty-input edge case — good ordering with no wasted sentences. The very long inline format enumeration is informative but consumes a lot of the paragraph's budget; a compact list would read faster.

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?

An output schema exists, yet the description still summarizes the return shape and the confidence interpretation threshold, which is the part an agent actually needs to act on results. Combined with the binary-vs-text encoding caveat and the "identify, never transform" boundary, nothing needed to call this correctly is missing.

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

Parameters5/5

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

Schema coverage is already 100%, but the description adds a genuinely non-obvious rule the schema cannot convey: inputEncoding "base64"/"hex" is only for delivering binary payloads such as gzip bytes because it is decoded before detection, so a base64 string you want identified must stay "text". That is exactly the kind of guidance that prevents a silent misclassification.

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?

"Guess what `input` is" gives a specific verb and resource, and the enumerated format list (JSON, YAML, JWT, UUID, gzip, Morse, ROT13...) makes the scope concrete rather than vague. It also states the exact return shape {candidates: [{format, confidence, note}]}, best first, so an agent can distinguish it immediately from siblings like run_utility or list_utilities.

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?

Explicit when-to-use ("handed an opaque or unlabelled value and must pick a utility for it") and explicit when-to-skip ("skip it when the format is already known"). It also names the downstream alternative path — list_utilities then run_utility — including a concrete example mapping (base64 -> base64_decode, JWT -> jwt_decode).

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