Skip to main content
Glama
thichcode

Matomo MCP Server

by thichcode

matomo_get_users

Retrieve all user accounts from Matomo Analytics to manage access permissions and user administration.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that retrieves the list of Matomo users by calling the 'UsersManager.getUsers' API endpoint via the private makeRequest method.
    async getUsers(): Promise<MatomoUser[]> {
      const response = await this.makeRequest('UsersManager.getUsers');
      return Array.isArray(response) ? response : [];
    }
  • MCP server wrapper handler that validates the Matomo service connection and delegates to MatomoApiService.getUsers(), formatting the response as MCP content.
    private async handleGetUsers() {
      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 users = await this.matomoService.getUsers();
      return {
        content: [
          {
            type: 'text',
            text: `Danh sách users:\n${JSON.stringify(users, null, 2)}`,
          },
        ],
      };
    }
  • Tool registration schema defining the 'matomo_get_users' tool with empty input schema (no parameters required).
    {
      name: 'matomo_get_users',
      description: 'Lấy danh sách tất cả users trong Matomo',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • src/index.ts:265-267 (registration)
    Registration of the tool handler in the CallToolRequestSchema switch statement, dispatching to handleGetUsers().
    case 'matomo_get_users':
      return await this.handleGetUsers();
  • Helper method used by getUsers to make authenticated HTTP requests to the Matomo API.
    private async makeRequest(method: string, params: Record<string, any> = {}): Promise<any> {
      const requestParams = {
        module: 'API',
        format: 'JSON',
        token_auth: this.config.tokenAuth,
        ...params,
      };
    
      try {
        const response = await this.client.get('', { params: requestParams });
        return response.data;
      } catch (error) {
        if (axios.isAxiosError(error)) {
          throw new Error(`Matomo API error: ${error.response?.data?.message || error.message}`);
        }
        throw error;
      }
    }
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 of behavioral disclosure. It describes a read operation ('get list'), which implies it's likely non-destructive, but doesn't specify authentication requirements, rate limits, pagination, or error handling. For a tool with zero annotation coverage, this leaves significant gaps in understanding its 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, clear sentence in Vietnamese that directly states the tool's function without any fluff. It's front-loaded and efficiently conveys the core purpose, making it appropriately sized for a simple tool.

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?

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is adequate but minimal. It covers the basic purpose but lacks details on usage context, behavioral traits, or output format, which could help an agent use it more effectively despite the low complexity.

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 parameters need documentation. The description doesn't add parameter details, but that's acceptable since there are none to explain. It implies the tool fetches all users without filtering, which aligns with the empty 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 verb ('Lấy danh sách' = 'Get list') and resource ('tất cả users trong Matomo' = 'all users in Matomo'), making the purpose specific and understandable. It distinguishes from siblings like matomo_get_site or matomo_get_goals by focusing on users, though it doesn't explicitly contrast with matomo_add_user or other user-related tools.

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?

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't mention if this is for listing all users versus filtered subsets, or how it differs from matomo_add_user for user management. The description only states what it does, not when to apply it.

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