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

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)

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