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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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()
Behavior3/5

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

Without annotations, the description carries the full burden. It discloses the return format (JSON with counts/percentages), which adds value, but omits safety characteristics (read-only vs. destructive), performance implications for large datasets, or idempotency.

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?

Two distinct sections (purpose and returns) with no wasted words. Information is front-loaded and appropriately sized for the tool's simplicity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given zero parameters and the existence of an output schema (per context signals), the description adequately covers the tool's function by specifying the return structure. Minor gap regarding dataset prerequisites prevents a 5.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Zero parameters with 100% schema coverage establishes a baseline of 4. The description appropriately requires no parameter clarification since the tool operates on the implicit current dataset context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a clear action (Get) and resource (distribution of emotions), but fails to distinguish from sibling tool 'count_by_emotion'. Both tools appear to provide counts; the description doesn't clarify when percentages/distribution analysis is preferable to simple counting.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance provided on when to use this tool versus 'count_by_emotion' or other siblings. No prerequisites are mentioned (e.g., whether a dataset must be loaded first), leaving usage context entirely implicit.

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

Install Server

Other Tools

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