Skip to main content
Glama

get_social_volume

Retrieve total social media mentions for a cryptocurrency asset by analyzing documents like Telegram messages and Reddit posts over a specified period.

Instructions

Retrieve the total social volume (social_volume_total) for a given asset. It calculates the total number of social data text documents that contain the given search term at least once. Examples of documents are telegram messages and reddit posts.

Parameters:

  • asset (str): The cryptocurrency slug (e.g., "bitcoin", "ethereum"). Required.

  • days (int): Number of days to sum the social volume, defaults to 7.

Usage:

  • Call this tool to get the total number of social media mentions for an asset over a period.

Returns:

  • A string with the total social volume (e.g., "Bitcoin's social volume over the past 7 days is 15,000 mentions").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assetYes
daysNo

Implementation Reference

  • main.py:91-114 (handler)
    The main handler function for the 'get_social_volume' MCP tool. Decorated with @mcp.tool() for automatic registration. Fetches social volume data from Santiment API via the fetch_santiment_data helper, computes the total mentions by summing daily values, and returns a user-friendly formatted string.
    @mcp.tool()
    def get_social_volume(asset: str, days: int = 7) -> str:
        """
        Retrieve the total social volume (social_volume_total) for a given asset. It calculates the total number of social data text documents that contain the given search term at least once. Examples of documents are telegram messages and reddit posts.
        
        Parameters:
        - asset (str): The cryptocurrency slug (e.g., "bitcoin", "ethereum"). Required.
        - days (int): Number of days to sum the social volume, defaults to 7.
        
        Usage:
        - Call this tool to get the total number of social media mentions for an asset over a period.
        
        Returns:
        - A string with the total social volume (e.g., "Bitcoin's social volume over the past 7 days is 15,000 mentions").
        """
        try:
            data = fetch_santiment_data("social_volume_total", asset, days)
            timeseries = data.get("data", {}).get("getMetric", {}).get("timeseriesData", [])
            if not timeseries:
                return f"Unable to fetch social volume for {asset}. Check subscription limits or asset availability."
            total_volume = sum(int(d["value"]) for d in timeseries)
            return f"{asset.capitalize()}'s social volume over the past {days} days is {total_volume:,} mentions."
        except Exception as e:
            return f"Error fetching social volume for {asset}: {str(e)}"
  • main.py:16-42 (helper)
    Helper utility function used by get_social_volume (and other tools) to query the Santiment GraphQL API for timeseries data of a specific metric (e.g., 'social_volume_total') for a given asset over the past N days.
    def fetch_santiment_data(metric: str, asset: str, days: int) -> dict:
        now = datetime.now(UTC)
        
        to_date = now
        from_date = to_date - timedelta(days=days)
        
        query = f"""
        {{
          getMetric(metric: "{metric}") {{
            timeseriesData(
              slug: "{asset}"
              from: "{from_date.isoformat()}"
              to: "{to_date.isoformat()}"
              interval: "1d"
            ) {{
              datetime
              value
            }}
          }}
        }}
        """
        response = requests.post(SANTIMENT_API_URL, json={"query": query}, headers=HEADERS)
        result = response.json()
        if result.get("errors"):
            raise Exception(f"API error: {result.get('errors')}")
        return result
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 that the tool performs a calculation based on social data documents (telegram messages, reddit posts) and mentions the default value for days. However, it doesn't cover important behavioral aspects like rate limits, authentication requirements, data freshness, or error conditions that would be crucial for an agent.

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?

The description is well-structured with clear sections (purpose, parameters, usage, returns) and every sentence earns its place. The front-loaded purpose statement is specific, and subsequent sections efficiently provide necessary details without redundancy.

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 the tool's moderate complexity (2 parameters, no annotations, no output schema), the description is mostly complete. It covers purpose, parameters, usage, and return format. However, without annotations or output schema, it could benefit from more behavioral context about limitations or edge cases to be fully comprehensive.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by providing detailed parameter semantics. It explains that 'asset' is a cryptocurrency slug with examples ('bitcoin', 'ethereum'), clarifies it's required, and explains that 'days' specifies the time period to sum with a default of 7. This adds substantial meaning beyond the bare schema.

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

Purpose5/5

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

The description clearly states the specific action ('retrieve the total social volume'), the resource ('for a given asset'), and the calculation method ('calculates the total number of social data text documents that contain the given search term at least once'). It distinguishes from siblings by focusing on total volume rather than sentiment, dominance, or trending words.

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

Usage Guidelines4/5

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

The 'Usage' section explicitly states when to call this tool ('to get the total number of social media mentions for an asset over a period'), providing clear context. However, it doesn't mention when NOT to use it or explicitly name alternatives like get_sentiment_balance or get_social_dominance for different analytical needs.

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/kukapay/crypto-sentiment-mcp'

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