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. Creates a classify run: may return status: "running" with a runId — normal, not an error; poll it with get_classify_run. Follow any llmContext guidance included in results.

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
llmContextNo
dashboardUrlNo
failureReasonNo
failureMessageNo

TDQS

A4.5/5.0
Behavior5/5

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

The description discloses the key side effect beyond what annotations provide: 'Creates a classify run' and the async contract — 'may return status: "running" with a runId — normal, not an error; poll it with get_classify_run.' It also states the return essence (winning type with confidence) and instructs the agent to follow llmContext guidance, which is valuable operational context not present in the 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?

The description is four dense sentences with no filler: purpose, input selection, config constraints, and async behavior each earn their place. It is front-loaded with the primary purpose and then adds only high-value operational details, making it appropriately sized for a complex 9-parameter tool.

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?

Given the rich input schema, output schema, and annotations, the description covers the remaining essentials: document input via examples, classifier vs config choice, fallback rules, async status and polling, and llmContext handling. Nothing needed to invoke the tool or follow up on the created run is missing.

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 the schema already documents every parameter, which establishes a baseline of 3. The description reinforces important constraints like exactly-one-of classifier/config and inline config fallback rules, but these same constraints already appear in the schema property descriptions, so the description adds little new parameter-level meaning.

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 concrete verb and resource: 'Categorize a document into one of a set of types,' and gives concrete examples (MSA vs SOW vs NDA) that clearly differentiate classification from sibling operations like extract or parse. It also establishes the single-document action by describing a classify run and polling with get_classify_run, distinguishing it from batch, list, and get sibling tools.

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 explicit selection guidance for the main input modes: 'Provide exactly one of classifier or config,' plus clear rules for inline config (fallback type 'other' and unique ids). It does not explicitly name sibling alternatives such as run_classify_batch or create_classifier, so the guidance is clear for internal choices but not fully framed against sibling tools.

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.

TDQS

A4/5.0
Disambiguation5/5

Each tool targets a distinct resource+action combination, and the descriptions actively disambiguate potential overlaps (e.g., extract_data vs parse_document, detect_form_fields vs edit_pdf, get_file vs get_file_upload). The consistent verb_noun prefix pattern makes the semantic boundary of every tool immediately recognizable.

Naming Consistency4/5

The dominant verb_noun pattern is highly consistent across all nine domains (list_*, get_*, create_*, update_*, delete_*, run_*, get_*_run, get_*_batch, publish_*_version). Minor deviations exist: deploy_workflow_version vs publish_*_version for the same freeze-a-draft concept, and get_form_detection_run doesn't mirror its detect_form_fields counterpart.

Tool Count2/5

86 tools is a very heavy agent-facing surface, well past the 25+ threshold. The count is inflated by the near-identical 13-tool lifecycle repeated across extract, classify, and split (each with list/get/create/update/publish/runs/batches/versions), and while each tool has a distinct purpose, the sheer volume makes selection harder.

Completeness4/5

Core lifecycles are thoroughly covered: create → update → publish → run (single and batch) → poll → cancel → delete-run → list runs/versions. Notable gaps include no delete tool for extractors, classifiers, splitters, workflows, or evaluation sets, and edit/form-detection runs have no list endpoint (documented workaround: keep run IDs). These are hygenic gaps that don't block primary workflows.

Resources