Skip to main content
Glama
thichcode

Matomo MCP Server

by thichcode

matomo_add_site

Add a new site to Matomo Analytics for tracking and monitoring website performance data through the Matomo MCP Server.

Instructions

Thêm một site mới vào Matomo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesTên của site
urlsYesDanh sách URLs của site
timezoneNoMúi giờ của site (mặc định: UTC)UTC

Implementation Reference

  • Core implementation of the matomo_add_site tool: calls Matomo SitesManager.addSite API via makeRequest helper.
    async addSite(name: string, urls: string[], timezone: string = 'UTC'): Promise<number> {
      const response = await this.makeRequest('SitesManager.addSite', {
        siteName: name,
        urls: urls.join(','),
        timezone,
      });
      return response.value;
    }
  • MCP server handler wrapper for matomo_add_site: checks connection and delegates to MatomoApiService.addSite.
    private async handleAddSite(args: { name: string; urls: string[]; timezone?: string }) {
      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 siteId = await this.matomoService.addSite(args.name, args.urls, args.timezone);
      return {
        content: [
          {
            type: 'text',
            text: `Đã thêm site thành công với ID: ${siteId}`,
          },
        ],
      };
  • Input schema definition for the matomo_add_site tool, specifying parameters name, urls (required), and optional timezone.
    inputSchema: {
      type: 'object',
      properties: {
        name: {
          type: 'string',
          description: 'Tên của site',
        },
        urls: {
          type: 'array',
          items: { type: 'string' },
          description: 'Danh sách URLs của site',
        },
        timezone: {
          type: 'string',
          description: 'Múi giờ của site (mặc định: UTC)',
          default: 'UTC',
        },
      },
      required: ['name', 'urls'],
  • src/index.ts:79-102 (registration)
    Tool registration in ListToolsResponse: defines name, description, and inputSchema for matomo_add_site.
    {
      name: 'matomo_add_site',
      description: 'Thêm một site mới vào Matomo',
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: 'Tên của site',
          },
          urls: {
            type: 'array',
            items: { type: 'string' },
            description: 'Danh sách URLs của site',
          },
          timezone: {
            type: 'string',
            description: 'Múi giờ của site (mặc định: UTC)',
            default: 'UTC',
          },
        },
        required: ['name', 'urls'],
      },
    },
  • src/index.ts:262-263 (registration)
    Dispatch registration in CallToolRequestSchema switch statement.
    case 'matomo_add_site':
      return await this.handleAddSite(args as { name: string; urls: string[]; timezone?: string });
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool adds a new site, implying a write operation, but fails to mention critical aspects like required permissions, potential side effects (e.g., if duplicate sites are allowed), error handling, or response format. This leaves significant gaps in understanding the tool's 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 directly states the tool's purpose without unnecessary words. It is front-loaded and wastes no space, making it easy to parse quickly. This exemplifies optimal conciseness for a simple 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 the tool's complexity as a write operation with no annotations and no output schema, the description is insufficient. It lacks details on behavioral traits (e.g., authentication needs, error cases), usage context, and what the tool returns. For a mutation tool, this minimal description does not provide enough information for an AI agent to use it effectively and safely.

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, with clear documentation for each parameter (name, urls, timezone). The description does not add any semantic details beyond what the schema provides, such as examples or constraints not in the schema. Given the high schema coverage, a baseline score of 3 is appropriate, as the description does not compensate but also does not detract.

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 ('Thêm một site mới' - 'Add a new site') and the resource ('vào Matomo' - 'to Matomo'), making the purpose unambiguous. However, it does not differentiate this tool from its siblings (e.g., matomo_add_goal, matomo_add_user), which are also creation tools but for different resources, so it falls short of a perfect score.

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 does not mention prerequisites, such as needing authentication or connectivity, nor does it specify scenarios where this tool is appropriate over other sibling tools like matomo_get_sites or matomo_get_site. This lack of contextual direction limits its utility for an AI agent.

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