Skip to main content
Glama

Classify entry via LLM sampling

classify_entry
Read-only

Use model-driven LLM sampling to classify a statement entry into one semantic category, returning category, confidence, and explanation. Choose custom categories or use built-in defaults.

Instructions

Classify one statement entry into a category via MCP LLM Sampling.

Use this when you want a semantic, model-driven label for an entry (payroll,
fee, refund, …) rather than a deterministic rule match. Because it delegates
an LLM completion to the client it is open-world and non-idempotent; for the
fixed candidate categories it chooses from, call
``list_classify_entry_categories`` first.

Uses the **MCP Sampling** protocol primitive: the server (this
process) asks the *client* (the agent's host application) to
perform an LLM completion on the server's behalf, then receives
the model's structured response. Keeps every LLM call in the
operator's existing model contract (privacy, billing, audit).

The model is asked to choose exactly one category from
``categories`` (or :data:`camt053_mcp.classify.DEFAULT_CATEGORIES`
if ``None`` is passed) and return a structured
``{category, confidence, explanation}`` payload.

Clients that do not support Sampling will get an
``{"error": "..."}`` envelope and can fall back to a rules-only
classifier.

Args:
    ctx: The MCPServer Context (auto-injected; provides
        ``session.create_message``).
    entry: A statement entry dict (the shape returned by
        ``parse_statement`` / ``list_entries``).
    categories: The candidate categories. ``None`` uses the
        built-in default list (12 common payment buckets).

Returns:
    ``{"category", "confidence", "explanation"}`` on success or
    ``{"error": "..."}`` on Sampling failure / malformed model
    response / out-of-vocabulary category.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entryYesA single statement entry dict, in the shape returned by parse_statement / list_entries, to classify into one category.
categoriesNoThe candidate categories the model must choose exactly one from. None (the default) uses the built-in default list exposed by list_classify_entry_categories.
Behavior4/5

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

The description provides significant behavioral context: it explains the open-world, non-idempotent nature, the delegation to the client via MCP Sampling (with privacy/billing/audit implications), the error envelope format, and the success/failure return structure. Annotations already provide openWorldHint=true, idempotentHint=false, and readOnlyHint=true, which the description aligns with and expands upon (e.g., mentioning the error envelope and the need for client support). The description adds value beyond annotations but does not explicitly cover failure modes like rate limiting or retry behavior, which 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is comprehensive but well-organized: it starts with a one-sentence summary, then adds usage context, a detailed protocol explanation, and finally structured Args/Returns sections. Every paragraph adds meaningful information without redundancy. The structure with clear section headers makes it scannable.

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 a 2-parameter tool with nested objects, complex behavioral implications (delegating to client via Sampling, error cases), and no output schema, the description covers everything an agent needs: input expectations, prerequisites, failure modes, return format, and the non-idempotent nature. The description is thorough and leaves no critical gaps for correct invocation.

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?

The schema description coverage is 100%, with detailed descriptions for both parameters. The description adds significant context on top: it specifies the exact shape of 'entry' (as returned by parse_statement / list_entries), explains the meaning of 'categories' (including the default None behavior and the built-in default list), and describes the return payload structure. It also clarifies the relationship with list_classify_entry_categories. This goes well beyond the schema.

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 clearly states the verb (classify), the resource (one statement entry), and the mechanism (via MCP LLM Sampling). It distinguishes this from deterministic rule matching and explicitly contrasts with sibling list_classify_entry_categories. The purpose is immediately understandable.

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?

The description explicitly states when to use this tool ('when you want a semantic, model-driven label rather than a deterministic rule match'), mentions an important prerequisite (call list_classify_entry_categories first to get the fixed categories), and describes fallback behavior for clients without Sampling support. This is exemplary guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sebastienrousseau/camt053-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server