Skip to main content
Glama
cegme

Emotion Dataset Analysis MCP Server

by cegme

analyze_emotion_distribution

Analyze the distribution of emotions across a Twitter dataset to understand sentiment patterns and frequency of emotional labels.

Instructions

Get the distribution of emotions in the dataset.

Returns: JSON string with counts and percentages for each emotion

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The implementation of the analyze_emotion_distribution tool, which calculates emotion distribution from a dataset.
    def analyze_emotion_distribution() -> str:
        """Get the distribution of emotions in the dataset.
    
        Returns:
            JSON string with counts and percentages for each emotion
        """
        dataset = get_dataset()
    
        counter = Counter(sample["label"] for sample in dataset)
        total = len(dataset)
    
        distribution = []
        for label_id, count in counter.most_common():
            distribution.append({
                "emotion": EMOTION_LABELS[label_id],
                "count": count,
                "percentage": round((count / total) * 100, 2)
            })
    
        return json.dumps({
            "total_samples": total,
            "distribution": distribution
        }, indent=2)
  • server.py:143-143 (registration)
    MCP tool registration for analyze_emotion_distribution.
    @mcp.tool()

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/cegme/cis6930sp26-assignment1.5'

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