Skip to main content
Glama
JussCubs

mcp-server-test

by JussCubs

fetch_token_broadcasts

Fetch broadcasts for a specific token ID to get token-related broadcast data in JSON format.

Instructions

Fetch broadcasts for a specific token

Args:
    token_id: Vector token ID
    
Returns:
    JSON string with token broadcasts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
token_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Main handler function for fetch_token_broadcasts tool. Sends a GraphQL query to fetch token broadcasts with optional pagination and sorting parameters.
    @mcp.tool(name="fetch_token_broadcasts")
    async def fetch_token_broadcasts(
        token_id: str,
        ctx: Context = None
    ) -> str:
        """Fetch broadcasts for a specific token
        
        Args:
            token_id: Vector token ID
            
        Returns:
            JSON string with token broadcasts
        """
        if ctx:
            ctx.info(f"Fetching broadcasts for token {token_id}...")
        
        # Hardcoded variables as requested
        variables = {
            "id": token_id,
            "after": None,
            "first": 100,
            "sortBy": "Time",
            "sortDirection": "Desc"
        }
        
        payload = {
            "query": TOKEN_BROADCASTS_QUERY,
            "variables": variables
        }
        
        async with httpx.AsyncClient(verify=False) as client:
            try:
                response = await client.post(
                    API_URL, 
                    json=payload, 
                    headers=HEADERS
                )
                response.raise_for_status()
                return response.text
            except Exception as e:
                error_message = f"Error fetching token broadcasts: {str(e)}"
                if ctx:
                    ctx.error(error_message)
                return error_message 
  • GraphQL query schema used by fetch_token_broadcasts. Defines the TokenBroadcastsQuery with parameters for ID, pagination (after, first), sorting (sortBy, sortDirection), and returns broadcast messages.
    TOKEN_BROADCASTS_QUERY = """
    query TokenBroadcastsQuery(
        $id: ID!
        $after: String
        $first: Int = 100
        $sortBy: TokenBroadcastSortBy
        $sortDirection: TokenBroadcastSortDirection
    ) {
        tokenBroadcasts(
            id: $id
            after: $after
            first: $first
            sortBy: $sortBy
            sortDirection: $sortDirection
        ) {
            edges {
                node {
                    broadcast {
                        message
                    }
                }
            }
        }
    }
    """
  • Registration of the fetch_token_broadcasts tool via the @mcp.tool decorator.
    @mcp.tool(name="fetch_token_broadcasts")
Behavior3/5

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

With no annotations provided, the description must disclose behavioral traits. It states the return format ('JSON string with token broadcasts'), which adds context beyond the schema. However, it does not explicitly confirm that it is read-only, nor does it mention any side effects, authorization needs, or rate limits. The term 'Fetch' implies a safe read operation, but explicit confirmation would improve transparency.

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 short and concise, with the main purpose front-loaded. It uses a clear structure with separate lines for parameters and returns. The length is appropriate for a simple tool with one parameter.

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 low complexity (one parameter, output schema exists), the description covers the essential aspects: what it does, the parameter, and the return type. The output schema is assumed to detail the return structure, so the description need not elaborate further. It is sufficiently complete for its context.

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

Parameters2/5

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

The input schema has 0% description coverage for parameters. The description adds minimal meaning by stating 'token_id: Vector token ID', which specifies the type of token ID. However, it does not explain what a 'Vector token ID' is, nor does it provide examples or constraints beyond the schema. With such low coverage, the description should compensate more.

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 that the tool fetches broadcasts for a specific token, using a specific verb ('Fetch') and resource ('broadcasts'). It distinguishes itself from siblings like 'fetch_leaderboard', 'fetch_profile', and 'fetch_token_data' by focusing on broadcasts.

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?

The description provides no guidance on when to use this tool vs. alternatives. It does not mention any context, prerequisites, or scenarios where this tool is preferable. The usage is only implied by the tool name and description.

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/JussCubs/mcp-server-test'

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