Skip to main content
Glama
thichcode

Matomo MCP Server

by thichcode

matomo_get_goals

Retrieve goals list for a Matomo site to track and analyze conversion metrics using site ID.

Instructions

Lấy danh sách goals của một site

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteIdYesID của site

Implementation Reference

  • Core implementation of the matomo_get_goals tool. Makes API request to Matomo's Goals.getGoals endpoint for the given siteId and returns the goals array.
    async getGoals(siteId: number): Promise<MatomoGoal[]> {
      const response = await this.makeRequest('Goals.getGoals', { idSite: siteId });
      return Array.isArray(response) ? response : [];
    }
  • Input schema definition for the matomo_get_goals tool, specifying siteId as required number parameter.
    inputSchema: {
      type: 'object',
      properties: {
        siteId: {
          type: 'number',
          description: 'ID của site',
        },
      },
      required: ['siteId'],
    },
  • src/index.ts:137-150 (registration)
    Tool registration in ListToolsRequestSchema handler, including name, description, and input schema.
    {
      name: 'matomo_get_goals',
      description: 'Lấy danh sách goals của một site',
      inputSchema: {
        type: 'object',
        properties: {
          siteId: {
            type: 'number',
            description: 'ID của site',
          },
        },
        required: ['siteId'],
      },
    },
  • src/index.ts:271-272 (registration)
    Dispatch in CallToolRequestSchema switch statement to the handleGetGoals method.
    case 'matomo_get_goals':
      return await this.handleGetGoals(args as { siteId: number });
  • MCP server handler wrapper that checks connection, calls MatomoApiService.getGoals, and formats response.
    private async handleGetGoals(args: { siteId: number }) {
      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 goals = await this.matomoService.getGoals(args.siteId);
      return {
        content: [
          {
            type: 'text',
            text: `Danh sách goals:\n${JSON.stringify(goals, null, 2)}`,
          },
        ],
      };
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 it retrieves a list, implying a read-only operation, but doesn't cover aspects like authentication needs, rate limits, error handling, or what the returned list contains. This leaves significant gaps for a tool with no 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.

Conciseness4/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's appropriately sized for a simple tool, though it could be slightly more informative to improve completeness.

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. It doesn't explain what the returned goals list includes (e.g., structure, fields) or any behavioral traits like permissions or limitations. For a tool with no structured data support, this description falls short of providing sufficient context.

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 description doesn't add any parameter-specific information beyond what's in the schema, which has 100% coverage and clearly documents the 'siteId' parameter. This meets the baseline score of 3, as the schema adequately handles parameter semantics without needing extra description.

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' meaning 'Get list') and resource ('goals của một site' meaning 'goals of a site'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'matomo_get_sites' or 'matomo_get_system_info' which also retrieve data, so it doesn't reach the highest 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 doesn't mention sibling tools like 'matomo_get_sites' or explain that this is for goals specifically, leaving the agent to infer usage from the name 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