Skip to main content
Glama

telegraph_get_views

Retrieve view count statistics for Telegraph pages, with optional filtering by year, month, day, or hour to analyze traffic patterns.

Instructions

Get the number of views for a Telegraph page. Can filter by year, month, day, or hour.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the Telegraph page
yearNoYear (2000-2100, required if month is passed)
monthNoMonth (1-12, required if day is passed)
dayNoDay (1-31, required if hour is passed)
hourNoHour (0-24)

Implementation Reference

  • Tool handler case that validates input using GetViewsSchema, calls telegraph.getViews API wrapper, and returns JSON-formatted result as MCP content.
    case 'telegraph_get_views': {
      const input = GetViewsSchema.parse(args);
      const result = await telegraph.getViews(
        input.path,
        input.year,
        input.month,
        input.day,
        input.hour
      );
      return {
        content: [{
          type: 'text' as const,
          text: JSON.stringify(result, null, 2),
        }],
      };
    }
  • Tool registration in pageTools array, including name, description, and inputSchema for MCP tool registry.
      {
        name: 'telegraph_get_views',
        description: 'Get the number of views for a Telegraph page. Can filter by year, month, day, or hour.',
        inputSchema: {
          type: 'object' as const,
          properties: {
            path: {
              type: 'string',
              description: 'Path to the Telegraph page',
            },
            year: {
              type: 'integer',
              description: 'Year (2000-2100, required if month is passed)',
              minimum: 2000,
              maximum: 2100,
            },
            month: {
              type: 'integer',
              description: 'Month (1-12, required if day is passed)',
              minimum: 1,
              maximum: 12,
            },
            day: {
              type: 'integer',
              description: 'Day (1-31, required if hour is passed)',
              minimum: 1,
              maximum: 31,
            },
            hour: {
              type: 'integer',
              description: 'Hour (0-24)',
              minimum: 0,
              maximum: 24,
            },
          },
          required: ['path'],
        },
      },
    ];
  • Zod schema for input validation used in the tool handler.
    export const GetViewsSchema = z.object({
      path: z.string().describe('Path to the Telegraph page'),
      year: z.number().int().min(2000).max(2100).optional().describe('Year (required if month is passed)'),
      month: z.number().int().min(1).max(12).optional().describe('Month (required if day is passed)'),
      day: z.number().int().min(1).max(31).optional().describe('Day (required if hour is passed)'),
      hour: z.number().int().min(0).max(24).optional().describe('Hour (0-24)'),
    });
  • API wrapper function that makes the HTTP request to Telegraph's getViews endpoint using the shared apiRequest helper.
    export async function getViews(
      path: string,
      year?: number,
      month?: number,
      day?: number,
      hour?: number
    ): Promise<PageViews> {
      return apiRequest<PageViews>('getViews', {
        path,
        year,
        month,
        day,
        hour,
      });
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it mentions the filtering capability, it doesn't describe what the tool returns (e.g., view count format, error conditions, rate limits, or authentication requirements). For a tool with no annotation coverage, this leaves significant behavioral gaps.

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 perfectly concise with two clear sentences: the first states the core purpose, the second explains filtering capabilities. Every word earns its place with zero redundancy or wasted space.

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?

For a read-only tool with excellent schema coverage (100%) but no output schema, the description adequately covers the basic purpose and filtering. However, without annotations or output schema, it should ideally mention what format the view count returns (e.g., integer, JSON structure) to be fully complete for agent usage.

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?

Schema description coverage is 100%, so the schema already documents all 5 parameters thoroughly. The description adds minimal value by mentioning the filtering options ('year, month, day, or hour') but doesn't provide additional semantics beyond what's in the schema descriptions. This meets the baseline for high schema coverage.

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 ('Get the number of views') and resource ('for a Telegraph page'), distinguishing it from siblings like telegraph_get_page (which retrieves page content) or telegraph_get_page_list (which lists pages). It precisely defines what this tool does compared to other read operations.

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 implies usage context by mentioning filtering options ('Can filter by year, month, day, or hour'), suggesting this tool is for retrieving view statistics rather than general page information. However, it doesn't explicitly state when to use this versus alternatives like telegraph_get_page or provide any exclusion criteria.

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/NehoraiHadad/telegraph-mcp'

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