Skip to main content
Glama

get_social_dominance

Analyze cryptocurrency social media discussion share for specific assets to gauge market attention and sentiment trends.

Instructions

Retrieve the social dominance (social_dominance_total) for a given asset. Social Dominance shows the share of the discussions in crypto media that is referring to a particular asset or phrase.

Parameters:

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

  • days (int): Number of days to calculate average social dominance, defaults to 7.

Usage:

  • Call this tool to get the percentage of social media discussion dominated by the asset.

Returns:

  • A string with the average social dominance (e.g., "Bitcoin's social dominance over the past 7 days is 25.3%").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assetYes
daysNo

Implementation Reference

  • main.py:192-215 (handler)
    The @mcp.tool() decorated handler function that implements the get_social_dominance tool logic: fetches social_dominance_total data from Santiment API, computes the average over the specified days, and returns a formatted string.
    @mcp.tool()
    def get_social_dominance(asset: str, days: int = 7) -> str:
        """
        Retrieve the social dominance (social_dominance_total) for a given asset. Social Dominance shows the share of the discussions in crypto media that is referring to a particular asset or phrase.
        
        Parameters:
        - asset (str): The cryptocurrency slug (e.g., "bitcoin", "ethereum"). Required.
        - days (int): Number of days to calculate average social dominance, defaults to 7.
        
        Usage:
        - Call this tool to get the percentage of social media discussion dominated by the asset.
        
        Returns:
        - A string with the average social dominance (e.g., "Bitcoin's social dominance over the past 7 days is 25.3%").
        """
        try:
            data = fetch_santiment_data("social_dominance_total", asset, days)
            timeseries = data.get("data", {}).get("getMetric", {}).get("timeseriesData", [])
            if not timeseries:
                return f"Unable to fetch social dominance for {asset}. Check subscription limits or asset availability."
            avg_dominance = sum(float(d["value"]) for d in timeseries) / len(timeseries)
            return f"{asset.capitalize()}'s social dominance over the past {days} days is {avg_dominance:.1f}%."
        except Exception as e:
            return f"Error fetching social dominance for {asset}: {str(e)}"
  • main.py:16-42 (helper)
    Helper function to fetch timeseries data from Santiment GraphQL API for a given metric and asset over a time period, used by the get_social_dominance tool.
    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
  • main.py:192-192 (registration)
    The @mcp.tool() decorator registers the get_social_dominance function as an MCP tool.
    @mcp.tool()
  • Function signature with type hints and docstring defining input parameters and output format for the tool.
    def get_social_dominance(asset: str, days: int = 7) -> str:
        """
        Retrieve the social dominance (social_dominance_total) for a given asset. Social Dominance shows the share of the discussions in crypto media that is referring to a particular asset or phrase.
        
        Parameters:
        - asset (str): The cryptocurrency slug (e.g., "bitcoin", "ethereum"). Required.
        - days (int): Number of days to calculate average social dominance, defaults to 7.
        
        Usage:
        - Call this tool to get the percentage of social media discussion dominated by the asset.
        
        Returns:
        - A string with the average social dominance (e.g., "Bitcoin's social dominance over the past 7 days is 25.3%").
        """
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool retrieves data (read-only behavior) and explains what social dominance represents. However, it doesn't mention potential limitations like rate limits, authentication requirements, data freshness, or error conditions. The description adds some behavioral context but leaves gaps for a data retrieval tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (description, parameters, usage, returns) and front-loaded the core purpose. Most sentences earn their place, though the 'Usage' section slightly repeats the purpose. It's appropriately sized for a 2-parameter tool without being verbose.

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

Completeness3/5

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

Given 2 parameters with 0% schema coverage and no output schema, the description does a decent job explaining parameters and return format. However, for a data retrieval tool with no annotations, it lacks details on error handling, data sources, or example responses beyond a single string format. The completeness is adequate but has clear gaps.

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?

Schema description coverage is 0%, so the description must compensate. It clearly explains both parameters: 'asset' as a cryptocurrency slug with examples, and 'days' as the number of days for calculating average social dominance with a default value. This adds meaningful semantics beyond the bare schema. However, it doesn't specify constraints like valid slug formats or day ranges.

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 tool's purpose: 'Retrieve the social dominance (social_dominance_total) for a given asset' and explains what social dominance measures. It uses specific verbs ('retrieve', 'shows') and identifies the resource ('asset'), but doesn't explicitly differentiate from sibling tools like get_social_volume or get_sentiment_balance.

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

Usage Guidelines3/5

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

The description includes a 'Usage' section stating 'Call this tool to get the percentage of social media discussion dominated by the asset,' which provides implied context about when to use it. However, it doesn't explicitly mention when NOT to use it or suggest alternatives among the sibling tools (e.g., when to choose get_social_volume instead).

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