Skip to main content
Glama
PaulieB14

graph-polymarket-mcp

get_daily_stats

Retrieve daily platform statistics including volume, fees, trader counts, and market activity from the Beefy P&L subgraph for trend analysis and historical performance.

Instructions

Get daily platform statistics from the Beefy P&L subgraph: volume, fees, trader counts, and market activity per day. Use this for trend analysis and historical performance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNoNumber of recent days to return (1-90)

Implementation Reference

  • src/index.ts:438-469 (registration)
    Registration of the 'get_daily_stats' tool using server.registerTool with name 'get_daily_stats', description, input schema (days parameter), and handler function.
    // ---------------------------------------------------------------------------
    // Tool 10: get_daily_stats
    // ---------------------------------------------------------------------------
    server.registerTool(
      "get_daily_stats",
      {
        description:
          "Get daily platform statistics from the Beefy P&L subgraph: volume, fees, trader counts, and market activity per day. Use this for trend analysis and historical performance.",
        inputSchema: {
          days: z.number().min(1).max(90).default(7).describe("Number of recent days to return (1-90)"),
        },
      },
      async ({ days }) => {
        try {
          const query = `{
            dailyStats_collection(first: ${days}, orderBy: date, orderDirection: desc) {
              id
              date
              volume
              fees
              numTraders
              numNewMarkets
              numResolvedMarkets
            }
          }`;
          const data = await querySubgraph(SUBGRAPHS.beefy_pnl.ipfsHash, query);
          return textResult(data);
        } catch (error) {
          return errorResult(error);
        }
      }
    );
  • Handler function that executes the 'get_daily_stats' tool logic. It queries the Beefy P&L subgraph for dailyStats_collection (ordered by date descending) fetching volume, fees, numTraders, numNewMarkets, numResolvedMarkets for the specified number of days.
      async ({ days }) => {
        try {
          const query = `{
            dailyStats_collection(first: ${days}, orderBy: date, orderDirection: desc) {
              id
              date
              volume
              fees
              numTraders
              numNewMarkets
              numResolvedMarkets
            }
          }`;
          const data = await querySubgraph(SUBGRAPHS.beefy_pnl.ipfsHash, query);
          return textResult(data);
        } catch (error) {
          return errorResult(error);
        }
      }
    );
  • Input schema for get_daily_stats: expects a 'days' parameter (zod number, min 1, max 90, default 7) describing how many recent days of stats to return.
      inputSchema: {
        days: z.number().min(1).max(90).default(7).describe("Number of recent days to return (1-90)"),
      },
    },
  • Helper function textResult() used by the handler to format successful responses as JSON text content.
    function textResult(data: unknown) {
      return {
        content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }],
      };
    }
  • Helper function errorResult() used by the handler to format error responses.
    function errorResult(error: unknown) {
      const message = error instanceof Error ? error.message : String(error);
      return {
        content: [{ type: "text" as const, text: `Error: ${message}` }],
        isError: true,
      };
    }
Behavior3/5

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

No annotations are provided, so the description must carry the burden. It mentions the data source ('Beefy P&L subgraph'), implying a read-only operation. However, it does not disclose any specific behavioral traits such as data freshness, pagination behavior, or any rate limits. With no annotations, a score of 3 reflects marginal value beyond the basic read context.

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 two sentences, directly stating the purpose and the intended use case. Every sentence adds value, and the key information is front-loaded. No redundancies or filler.

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 has only one parameter with schema documentation, no output schema, and no annotations, the description provides sufficient context for an agent to understand what the tool does, what data it returns (volume, fees, etc.), and when to use it. A minor gap is the lack of information about the output format, but it is still reasonably complete.

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

Parameters3/5

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

The input schema has 100% description coverage for the only parameter ('days'), with clear bounds and default. The description does not add extra meaning beyond what the schema provides. According to the rubric, baseline is 3 when schema coverage is high, so this score is appropriate.

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 verb 'Get', the resource 'daily platform statistics', and lists specific metrics (volume, fees, trader counts, market activity). It distinguishes itself from sibling tools like get_global_stats by specifying 'from the Beefy P&L subgraph' and focus on daily data.

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 description explicitly says 'Use this for trend analysis and historical performance', indicating the appropriate context. It does not provide exclusions or alternatives, but the usage intent is clear and sufficient given the tool's simplicity.

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/PaulieB14/graph-polymarket-mcp'

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