Skip to main content
Glama
thichcode

Matomo MCP Server

by thichcode

matomo_get_sites

Retrieve all sites from Matomo Analytics to manage and monitor website tracking configurations through the Matomo MCP Server.

Instructions

Lấy danh sách tất cả các sites trong Matomo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for matomo_get_sites: validates connection, calls service.getSites(), formats and returns JSON response.
    private async handleGetSites() {
      if (!this.matomoService) {
        throw new Error('Chưa kết nối đến Matomo. Vui lòng sử dụng matomo_connect trước.');
      }
    
      const sites = await this.matomoService.getSites();
      return {
        content: [
          {
            type: 'text',
            text: `Danh sách sites:\n${JSON.stringify(sites, null, 2)}`,
          },
        ],
      };
  • Core handler logic: makes API request to Matomo's SitesManager.getSitesFromGroup and returns sites array.
    async getSites(): Promise<MatomoSite[]> {
      const response = await this.makeRequest('SitesManager.getSitesFromGroup');
      return Array.isArray(response) ? response : [];
    }
  • Tool schema definition: empty input schema as it requires no parameters.
    {
      name: 'matomo_get_sites',
      description: 'Lấy danh sách tất cả các sites trong Matomo',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • src/index.ts:256-257 (registration)
    Tool registration in the CallToolRequest switch dispatcher.
    case 'matomo_get_sites':
      return await this.handleGetSites();
  • TypeScript interface defining the structure of MatomoSite objects returned by the tool.
    export interface MatomoSite {
      idsite: number;
      name: string;
      main_url: string;
      ts_created: string;
      ecommerce: number;
      sitesearch: number;
      sitesearch_keyword_parameters: string;
      sitesearch_category_parameters: string;
      timezone: string;
      currency: string;
      exclude_unknown_urls: number;
      excluded_ips: string;
      excluded_parameters: string;
      excluded_user_agents: string;
      group: string;
      type: string;
      keep_url_fragment: number;
      creator_login: string;
      timezone_name: string;
      currency_name: string;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the action but lacks behavioral details such as whether this is a read-only operation, if it requires authentication, how results are formatted (e.g., pagination), or any rate limits. This is a significant gap for a tool with zero annotation coverage.

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 in Vietnamese that directly states the tool's purpose without unnecessary words. It's front-loaded and appropriately sized for a simple list-retrieval tool.

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 no annotations, no output schema, and 0 parameters, the description is minimal. It states what the tool does but lacks context on behavior, output format, or usage relative to siblings. For a tool in a set with multiple retrieval options, this leaves the agent under-informed about how to integrate it effectively.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate, but it could have mentioned if any implicit parameters (like authentication) are required. Baseline 4 is correct as it doesn't detract from the schema.

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 action ('Lấy danh sách' - Get list) and resource ('các sites trong Matomo' - sites in Matomo), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'matomo_get_site' (singular) or 'matomo_get_users', which suggests it retrieves all sites rather than filtering or targeting specific ones.

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. It doesn't mention sibling tools like 'matomo_get_site' (for a single site) or context for retrieving all sites, leaving the agent to infer usage based on tool names alone.

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/thichcode/matomo_mcp'

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