Skip to main content
Glama

Classify text

classify
Read-only

Label a text's sentiment, emotion, or toxicity locally with a small chosen model, returning the top label and its 0–1 score.

Instructions

Classify a text's sentiment, emotion or toxicity, locally, with a small model chosen by model. Returns the top label with its score from 0 to 1, then every label's score. Use it to label one text; to compare two texts use similarity, and to order passages by relevance use rerank. Each model downloads on first use (90-700 MB) and then answers in milliseconds.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "text": "<text>"
    },
    "name": "classify"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesThe text to classify: a sentence to a few paragraphs. English, except for bert-sentiment-multilingual.
modelNoWhich classifier. distilbert-sentiment (default): positive or negative, fastest. roberta-sentiment: negative, neutral or positive, tuned on social media. distilroberta-emotion: 7 emotions (anger, disgust, fear, joy, neutral, sadness, surprise). roberta-emotions: 28 finer emotions, several can apply at once. toxic-bert: toxic, severe_toxic, obscene, threat, insult, identity_hate, each scored on its own. bert-sentiment-multilingual: 1 to 5 stars, for English, German, French, Spanish, Italian and Dutch.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.8.5
    • changedInput schema / properties / model / description
      Previous value: -"Default distilbert-sentiment (positive/negative)."New value: +"Which classifier. distilbert-sentiment (default): positive or negative, fastest. roberta-sentiment: negative, neutral or positive, tuned on social media. distilroberta-emotion: 7 emotions (anger, disgust, fear, joy, neutral, sadness, surprise). roberta-emotions: 28 finer emotions, several can apply at once. toxic-bert: toxic, severe_toxic, obscene, threat, insult, identity_hate, each scored on its own. bert-sentiment-multilingual: 1 to 5 stars, for English, German, French, Spanish, Italian and Dutch."
    • addedInput schema / properties / text / description
      Added value: +"The text to classify: a sentence to a few paragraphs. English, except for bert-sentiment-multilingual."
  2. First observedv0.8.2

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare readOnlyHint and openWorldHint=false, so the description carries the rest and does so well: local inference, per-model first-use download of 90-700 MB, and millisecond latency afterwards — a cost an agent must plan around. It also discloses the return shape (top label with a 0-1 score, then all label scores), which annotations do not cover.

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?

Three sentences, each doing distinct work: purpose, sibling routing, then operational cost and return format. The most decision-relevant clause (single-text scope) is front-loaded before the alternatives.

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?

With no output schema, the description compensates by describing the return value ordering and score range. Combined with the download/latency note and full schema coverage on both parameters, an agent has everything needed to call this correctly.

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 enum documents every classifier in detail, so the description adds little beyond reiterating that `model` selects the classifier. Baseline 3 applies since the schema does the heavy lifting.

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?

States a specific verb and resource ('Classify a text's sentiment, emotion or toxicity') plus the scoping detail that it runs locally with a small model selected via `model`. It also names what it is not (similarity, rerank), so an agent can place it among siblings without opening schemas.

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 routing: 'Use it to label one text; to compare two texts use similarity, and to order passages by relevance use rerank.' This gives both the when-to-use condition and the named alternatives that displace it.

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