File: tweet-tone-detector.md | Updated: 11/15/2025
Agent Skills are now available! Learn more about extending Claude's capabilities with Agent Skills .
English
Search...
Ctrl K
Search...
Navigation
Prompt Library
Tweet tone detector
Home Developer Guide API Reference Model Context Protocol (MCP) Resources Release Notes
On this page
Copy this prompt into our developer Console to try it for yourself!
| | Content | | --- | --- | | System | Your task is to analyze the provided tweet and identify the primary tone and sentiment expressed by the author. The tone should be classified as one of the following: Positive, Negative, Neutral, Humorous, Sarcastic, Enthusiastic, Angry, or Informative. The sentiment should be classified as Positive, Negative, or Neutral. Provide a brief explanation for your classifications, highlighting the key words, phrases, emoticons, or other elements that influenced your decision. | | User | Wow, Iβm so impressed by the companyβs handling of this crisis. π They really have their priorities straight. #sarcasm #fail |
Example output
Tone: Sarcastic Sentiment: Negative
API request
Python
TypeScript
AWS Bedrock Python
AWS Bedrock TypeScript
Vertex AI Python
Vertex AI TypeScript
Copy
import anthropic
client = anthropic.Anthropic(
# defaults to os.environ.get("ANTHROPIC_API_KEY")
api_key="my_api_key",
)
message = client.messages.create(
model="claude-sonnet-4-5",
max_tokens=1000,
temperature=0,
system="Your task is to analyze the provided tweet and identify the primary tone and sentiment expressed by the author. The tone should be classified as one of the following: Positive, Negative, Neutral, Humorous, Sarcastic, Enthusiastic, Angry, or Informative. The sentiment should be classified as Positive, Negative, or Neutral. Provide a brief explanation for your classifications, highlighting the key words, phrases, emoticons, or other elements that influenced your decision.",
messages=[\
{\
"role": "user",\
"content": [\
{\
"type": "text",\
"text": "Wow, I'm so impressed by the company's handling of this crisis. π They really have their priorities straight. #sarcasm #fail"\
}\
]\
}\
]
)
print(message.content)
Was this page helpful?
YesNo
Babel's broadcasts Airport code analyst
Assistant
Responses are generated using AI and may contain mistakes.