Skip to main content
Glama
cegme

Emotion Dataset Analysis MCP Server

by cegme

search_text

Find emotion-labeled Twitter messages containing specific text queries to analyze sentiment patterns in the dataset.

Instructions

Search for samples containing specific text.

Args: query: Text to search for (case-insensitive) limit: Maximum results to return (default: 10)

Returns: JSON string with matching samples

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `search_text` tool implementation, annotated with `@mcp.tool()`, which searches the dataset for a given string.
    @mcp.tool()
    def search_text(query: str, limit: int = 10) -> str:
        """Search for samples containing specific text.
    
        Args:
            query: Text to search for (case-insensitive)
            limit: Maximum results to return (default: 10)
    
        Returns:
            JSON string with matching samples
        """
        query = query.lower()
        limit = min(max(limit, 1), 50)
        dataset = get_dataset()
    
        matches = []
        for idx, sample in enumerate(dataset):
            if query in sample["text"].lower():
                matches.append({
                    "text": sample["text"],
                    "emotion": EMOTION_LABELS[sample["label"]],
                    "index": idx
                })
                if len(matches) >= limit:
                    break
    
        return json.dumps({
            "query": query,
            "found": len(matches),
            "matches": matches
        }, indent=2)
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses case-insensitivity and that results are returned as a JSON string. However, it omits error handling behavior, what constitutes a 'sample', pagination details, or performance characteristics.

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?

Uses an efficient docstring format (Args/Returns) that front-loads the purpose statement and structures metadata clearly. Every line provides necessary information without redundancy; appropriate length for a 2-parameter tool.

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?

For a simple search tool with 2 parameters, the description adequately covers inputs and outputs. While additional domain context about 'samples' would help, the return format documentation and parameter details provide sufficient information for invocation given the low complexity.

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?

Despite 0% schema description coverage, the Args section compensates effectively by documenting both parameters: noting the case-insensitive nature of 'query' and the default value of 'limit'. It adds semantic meaning beyond the raw schema types.

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

Purpose4/5

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

The description clearly states the verb (search), resource (samples), and scope (containing specific text). While it doesn't explicitly differentiate from siblings like 'get_sample', the tool name and description make the text-search purpose distinct from the emotion analysis siblings.

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 explicit guidance on when to use this tool versus alternatives like 'get_sample' (which likely retrieves by ID). The description provides no when-to-use or when-not-to-use conditions, prerequisites, or workflow guidance.

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