Text Classification
Sort text into categories, your own or general ones. Returns the main category, confidence scores, topic keywords and a summary.
Pay by wallet (x402) AI-generated
classify-text Example
Example answer
{
"summary": "A statement describing sample text used for validating automated testing capabilities and system functionality.",
"confidence": 0.85,
"all_categories": [
{
"category": "Software Testing",
"confidence": 0.85
},
{
"category": "Quality Assurance",
"confidence": 0.72
},
{
"category": "Technical Documentation",
"confidence": 0.58
},
{
"category": "Automation",
"confidence": 0.65
}
],
"topic_keywords": [
"test input",
"automated testing",
"capability testing",
"QA"
],
"primary_category": "Software Testing",
"detected_language": "English"
} Inputs
| Field | Type | Required | What it is |
|---|---|---|---|
text | string | Yes | Text to classify |
categories | array | No | Optional list of categories to classify into |
Output fields
How reliably each field appears in a successful answer.
| Field | Type | Appears |
|---|---|---|
confidence | number | Always (present in every successful answer) |
all_categories | array | Always (present in every successful answer) |
topic_keywords | array | Always (present in every successful answer) |
primary_category | string | Always (present in every successful answer) |
How to call it
The same tool through each route. MCP clients reach it through Strale’s server at https://api.strale.io/mcp; the call below is what the agent sends.
# Needs an API key. max_price_cents caps what this call may cost.
curl -X POST https://api.strale.io/v1/do \
-H "Authorization: Bearer $STRALE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"capability_slug": "classify-text",
"inputs": {
"text": "This is a test input for automated capability testing."
},
"max_price_cents": 5
}' {
"tool": "strale_execute",
"arguments": {
"slug": "classify-text",
"inputs": {
"text": "This is a test input for automated capability testing."
},
"max_price_cents": 5
}
} import { Strale } from "straleio";
const strale = new Strale({ apiKey: process.env.STRALE_API_KEY! });
const result = await strale.do({
capability_slug: "classify-text",
inputs: {
"text": "This is a test input for automated capability testing."
},
max_price_cents: 5,
}); import os
from straleio import Strale, DoRequest
strale = Strale(api_key=os.environ["STRALE_API_KEY"])
result = strale.do(DoRequest(
capability_slug="classify-text",
inputs={
"text": "This is a test input for automated capability testing.",
},
max_price_cents=5,
)) # No account. The first request answers 402 with the price in USDC;
# an x402 client pays it from your wallet and repeats the request.
curl -i 'https://api.strale.io/x402/v2/classify-text?text=This+is+a+test+input+for+automated+capability+testing.' Limitations
Ambiguous text can be assigned to the wrong category
AI-powered classification — ambiguous text may be assigned to multiple categories or the wrong category without sufficient context
What to do instead: Provide the complete list of valid categories and a brief description of each in the input for more accurate classification
Related tools
- Sentiment Analysis €0.05
- Text Summary €0.05
- Translation €0.05