Sentiment Analysis

Read the sentiment of a text (positive, negative, neutral or mixed) with confidence scores and the sentiment towards each aspect.

Pay by wallet (x402) AI-generated sentiment-analyze

Example

Example answer
{
  "scores": {
    "neutral": 0.95,
    "negative": 0,
    "positive": 0.05
  },
  "aspects": [
    {
      "aspect": "purpose of the text",
      "sentiment": "neutral",
      "text_span": "test input for automated capability testing"
    }
  ],
  "summary": "The text is neutral in sentiment, describing a technical testing scenario without expressing any emotional valence.",
  "sentiment": "neutral",
  "confidence": 0.95,
  "detected_language": "English"
}

Inputs

FieldTypeRequiredWhat it is
textstringYesText to analyze

Output fields

How reliably each field appears in a successful answer.

FieldTypeAppears
scoresobjectAlways (present in every successful answer)
aspectsarrayAlways (present in every successful answer)
sentimentstringAlways (present in every successful answer)
confidencenumberAlways (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": "sentiment-analyze",
    "inputs": {
      "text": "This is a test input for automated capability testing."
    },
    "max_price_cents": 5
  }'

Limitations

  • Sarcasm and cultural expressions can be misread

    AI-based sentiment — sarcasm, irony, and culturally-specific expressions may be misinterpreted

    What to do instead: Use the confidence score in the response and flag low-confidence results for human review in critical applications

Related tools