Skip to main content
Glama
colintoh

Clicky MCP Server

by colintoh

get_total_visitors

Retrieve total visitor counts for a specified date range from Clicky website analytics to monitor traffic performance and analyze trends.

Instructions

Get total visitors for a date range from Clicky analytics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
start_dateYesStart date in YYYY-MM-DD format
end_dateYesEnd date in YYYY-MM-DD format

Implementation Reference

  • The main handler function for the get_total_visitors tool. Converts input dates to DateRange, calls ClickyClient.getTotalVisitors, formats the JSON response or error.
    export async function handleGetTotalVisitors(
      args: { start_date: string; end_date: string },
      clickyClient: ClickyClient
    ) {
      try {
        const dateRange: DateRange = {
          startDate: args.start_date,
          endDate: args.end_date
        };
    
        const data = await clickyClient.getTotalVisitors(dateRange);
        
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(data, null, 2)
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error fetching total visitors: ${error instanceof Error ? error.message : 'Unknown error'}`
            }
          ],
          isError: true
        };
      }
    }
  • Input schema for the get_total_visitors tool, validating start_date and end_date as YYYY-MM-DD strings.
    inputSchema: {
      type: 'object',
      properties: {
        start_date: {
          type: 'string',
          pattern: '^\\d{4}-\\d{2}-\\d{2}$',
          description: 'Start date in YYYY-MM-DD format'
        },
        end_date: {
          type: 'string',
          pattern: '^\\d{4}-\\d{2}-\\d{2}$',
          description: 'End date in YYYY-MM-DD format'
        }
      },
      required: ['start_date', 'end_date']
    }
  • Tool definition and export for get_total_visitors, including name, description, and input schema.
    export const getTotalVisitorsTool: Tool = {
      name: 'get_total_visitors',
      description: 'Get total visitors for a date range from Clicky analytics',
      inputSchema: {
        type: 'object',
        properties: {
          start_date: {
            type: 'string',
            pattern: '^\\d{4}-\\d{2}-\\d{2}$',
            description: 'Start date in YYYY-MM-DD format'
          },
          end_date: {
            type: 'string',
            pattern: '^\\d{4}-\\d{2}-\\d{2}$',
            description: 'End date in YYYY-MM-DD format'
          }
        },
        required: ['start_date', 'end_date']
      }
    };
  • src/index.ts:91-99 (registration)
    Registration of getTotalVisitorsTool in the ListToolsRequest handler.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        getTotalVisitorsTool,
        getDomainVisitorsTool,
        getTopPagesTool,
        getTrafficSourcesTool,
        getPageTrafficTool,
      ],
    }));
  • src/index.ts:106-107 (registration)
    Dispatch registration in the CallToolRequest switch statement for get_total_visitors.
    case 'get_total_visitors':
      return await handleGetTotalVisitors(args as any, this.clickyClient);
  • ClickyClient helper method that performs the actual API request to Clicky for total visitors data.
    async getTotalVisitors(dateRange: DateRange): Promise<any> {
      this.validateDateRange(dateRange);
    
      const response = await this.client.get('', {
        params: {
          site_id: this.siteId,
          sitekey: this.siteKey,
          type: 'visitors',
          date: `${dateRange.startDate},${dateRange.endDate}`,
          output: 'json'
        }
      });
    
      return response.data;
    }
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. It states what the tool does but doesn't describe how it behaves: no information about authentication requirements, rate limits, error handling, or what the return value looks like (e.g., is it a single number, a structured object?). For a data retrieval tool with zero annotation coverage, this leaves significant gaps in understanding operational behavior.

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 a single, efficient sentence that communicates the core purpose without unnecessary words. It's appropriately sized for a simple retrieval tool and front-loads the essential information ('Get total visitors'). Every word earns its place.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete for effective tool use. While the purpose is clear, it doesn't address key contextual elements: what format the result returns, whether authentication is needed, any rate limits, or how it differs from sibling tools. For a data retrieval tool in an analytics context, more operational context would be helpful.

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 input schema fully documents both parameters (start_date and end_date) with format patterns. The description adds no additional parameter semantics beyond implying date-range filtering. This meets the baseline expectation when schema does the heavy lifting, but doesn't provide extra context like date range constraints or timezone handling.

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 verb ('Get') and resource ('total visitors'), and specifies the data source ('from Clicky analytics'). It distinguishes itself from siblings by focusing on total visitor counts rather than domain-specific, page-level, or source-level metrics. However, it doesn't explicitly contrast with sibling tools like 'get_domain_visitors' which might also provide visitor counts.

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 versus alternatives like 'get_domain_visitors' or 'get_traffic_sources'. It doesn't mention prerequisites, limitations, or specific use cases. The agent must infer usage from the tool name alone, which is insufficient for optimal tool selection.

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/colintoh/clicky-mcp'

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