Skip to main content
Glama

Get daily metrics summary

getDailyMetrics

Retrieve daily aggregated usage, cost, and count metrics for traces and observations. Filter by user, environment, tags, or date range to monitor performance and costs.

Instructions

Fetch daily aggregated usage / cost / count metrics for traces and observations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number (default 1)
limitNoItems per page (default 50, max 100)
traceNameNo
userIdNo
tagsNo
environmentNo
fromTimestampNo
toTimestampNo

Implementation Reference

  • src/tools.ts:288-305 (registration)
    Registration of the 'getDailyMetrics' tool using server.registerTool() with name 'getDailyMetrics'.
    server.registerTool(
      "getDailyMetrics",
      {
        title: "Get daily metrics summary",
        description:
          "Fetch daily aggregated usage / cost / count metrics for traces and observations.",
        inputSchema: {
          ...paginationShape,
          traceName: z.string().optional(),
          userId: z.string().optional(),
          tags: z.array(z.string()).optional(),
          environment: z.string().optional(),
          fromTimestamp: z.string().datetime().optional(),
          toTimestamp: z.string().datetime().optional(),
        },
      },
      async (args) => asJson(await client.get("/api/public/metrics/daily", args)),
    );
  • Handler function: calls client.get('/api/public/metrics/daily', args) and wraps the result via asJson().
      async (args) => asJson(await client.get("/api/public/metrics/daily", args)),
    );
  • Input schema for getDailyMetrics: pagination (page, limit), traceName, userId, tags, environment, fromTimestamp, toTimestamp.
    inputSchema: {
      ...paginationShape,
      traceName: z.string().optional(),
      userId: z.string().optional(),
      tags: z.array(z.string()).optional(),
      environment: z.string().optional(),
      fromTimestamp: z.string().datetime().optional(),
      toTimestamp: z.string().datetime().optional(),
    },
  • timeRangeShape helper used by fromTimestamp/toTimestamp in the input schema.
    export const timeRangeShape = {
      fromTimestamp: z.string().datetime().optional().describe("ISO 8601 lower bound (inclusive)"),
      toTimestamp: z.string().datetime().optional().describe("ISO 8601 upper bound (exclusive)"),
    };
  • paginationShape helper used by page/limit in the input schema.
    export const paginationShape = {
      page: z.number().int().positive().optional().describe("Page number (default 1)"),
      limit: z
        .number()
        .int()
        .min(1)
        .max(100)
        .optional()
        .describe("Items per page (default 50, max 100)"),
    };
Behavior2/5

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

No annotations exist, and the description does not disclose behavioral aspects like pagination, rate limits, authentication needs, or response structure. It only states what data is fetched, leaving significant gaps.

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 a single concise sentence front-loading the core function. However, the brevity sacrifices needed detail, making it less helpful than a slightly longer but more informative description.

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

Completeness1/5

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

With 8 optional parameters, no output schema, and no annotations, the description is far from complete. The agent lacks critical information to correctly invoke the tool, such as parameter semantics and return format.

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

Parameters1/5

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

Schema description coverage is only 25% (only page and limit have descriptions), and the tool description adds no meaning to the 6 undocumented parameters. The agent receives no help understanding parameters like traceName, userId, tags, etc.

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 tool fetches daily aggregated usage/cost/count metrics for traces and observations, distinguishing it from sibling tools like getMetrics which likely provide non-aggregated or non-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 Guidelines2/5

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

No guidance is given on when to use this tool versus alternatives such as getMetrics or other list/get tools. The purpose is clear but no contextual comparisons or prerequisites are provided.

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/hugoles/langfuse-mcp'

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