Skip to main content
Glama

Extend MCP

Classify a document

classify_document

Categorize a document into one of a set of types, e.g. MSA vs SOW vs NDA (classify group), using a saved classifier or an inline list of classifications. Provide exactly one of classifier or config. Inline config.classifications must include one entry with type: "other" as the fallback and unique ids per entry. Returns the winning type with a confidence score. Async: a status: "running" result with a runId is not an error — resume with get_classify_run passing that runId, the same workspaceId and environment, and wait: true, repeating until the status is terminal; never re-submit the document. On UNAUTHORIZED or NOT_FOUND, re-call get_me for the granted targets. Output shape is documented at https://docs.extend.ai/classification/response-format.md (get_documentation).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesDocument to classify. Exactly one of id/url/text — e.g. { "url": "https://..." } or { "id": "file_..." }, never a bare string.
configNoInline classify config: { classifications: [{ id, type, description }], classificationRules?, advancedOptions?, parseConfig? }. Must include a type: "other" entry as the fallback; ids must be unique. Before authoring a config by hand, call get_documentation with https://docs.extend.ai/classification/configuration.md and follow it.
detailNo"concise" (default): status, output, failure fields, dashboardUrl. "full": adds config, confidence/citations, usage, timestamps.
metadataNoArbitrary key-value metadata stored on the run.
priorityNoQueue priority (1-100).
classifierNoSaved classifier to run. Provide exactly one of classifier or config.
environmentYes"TEST" = the Test (development) environment, "PRODUCTION" = live. Must match a granted target from get_me (an API key pins one environment).
waitSecondsNoMax seconds to block waiting on the run (clamped to the server wait budget).
workspaceIdYesTarget workspace (ws_...). Must be a granted workspace — get_me lists the accepted values.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNo
runIdYes
outputNoWinning classification (PROCESSED only).
statusYesTerminal status, or "running" (resume via the get tool).
runTypeNo
dashboardUrlNo
failureReasonNo
failureMessageNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • removedOutput schema / properties / llmContext
      Removed value: -{
      -  "type": "string"
      -}
  2. First observed

TDQS

A4.5/5.0
Behavior5/5

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

The description goes well beyond the annotations (readOnlyHint=false, openWorldHint=true, idempotentHint=false, destructiveHint=false) by disclosing the async contract: a status 'running' result with a runId is not an error, the caller must poll with get_classify_run, and re-submission is forbidden. It also documents error-recovery behavior for UNAUTHORIZED/NOT_FOUND, which the schema and annotations do not convey.

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?

The description is dense but every sentence earns its place: purpose and modes, config constraint, async polling behavior, error recovery, and output documentation link. It front-loads the core purpose before the async protocol, and avoids filler or repetition of the title.

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 complex 9-parameter, async mutation tool with nested inputs and an existing output schema, the description covers the essential invocation details: one-of classifier/config, config fallback requirements, async resumption, re-submission prohibition, auth failure handling, and where to find the output shape. Combined with 100% schema coverage, output schema, and annotations, nothing critical is left for an agent to guess.

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%, and the schema already documents the classifier/config exclusivity, the required 'other' fallback entry, unique ids, and environment constraints. The description restates these rules but adds little new parameter meaning beyond what the schema provides; the async and error-handling notes concern process behavior, not parameter semantics.

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?

The description opens with a specific verb-and-resource statement: 'Categorize a document into one of a set of types, e.g. MSA vs SOW vs NDA.' This clearly distinguishes the tool from siblings like extract_data, parse_document, and split_document, and names the two modes of operation (saved classifier or inline config).

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?

The description gives clear usage context: 'Provide exactly one of classifier or config,' explains the async workflow with get_classify_run, warns never to re-submit the document, and specifies what to do on UNAUTHORIZED/NOT_FOUND. It does not explicitly name alternatives such as run_classify_batch for batch usage, so it stops short of full when-to-use versus when-not-to-use guidance.

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