Skip to main content
Glama

Classify a document

classify_document

Detect the document type (receipt, invoice, contract, lease, …) without extracting fields. Cheap first step when you don't know which schema to use.

Input Schema

NameRequiredDescriptionDefault
file_nameNoOriginal file name, e.g. 'invoice.pdf' (helps type detection).
mime_typeNoMIME type if known, e.g. 'application/pdf', 'image/jpeg'. Inferred from file_name otherwise.
file_base64YesThe document bytes, base64-encoded. PDF, image (PNG/JPG/WEBP) or text file.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior3/5

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

No annotations, so the description carries the full load, and it does disclose two real traits: no field extraction happens, and the call is cheap (implying a cost gradient vs. extract_document). It omits idempotency, data-handling/auth requirements, and any rate or size limits, which matters for a tool that ingests raw document bytes.

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 tight sentences, front-loaded with the action and its distinguishing constraint, then the usage cue. Nothing is redundant or padded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description should say what comes back — a single label, a label plus confidence, the set of possible types — and it only offers an open-ended example list with '…'. Combined with zero annotations, the definition is usable but leaves the return contract and failure modes unspecified.

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%: file_base64, file_name and mime_type each have their own descriptions, including the detection hint for file_name and the inference fallback for mime_type. The description adds nothing parameter-level, so the 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?

Specific verb ('Detect') plus resource ('document type') with concrete examples (receipt, invoice, contract, lease). The clause 'without extracting fields' explicitly separates it from the sibling extract_document, so an agent can distinguish them without opening either schema.

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?

'Cheap first step when you don't know which schema to use' gives a clear triggering condition and implies the follow-on path (list_schemas / extract_document). It stops short of naming the alternative tool or stating when not to use it, so it is strong but not exhaustive.

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.