matomo_get_site
Retrieve detailed information about a specific Matomo Analytics site using its site ID to access configuration, settings, and metadata.
Instructions
Lấy thông tin chi tiết của một site
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| siteId | Yes | ID của site cần lấy thông tin |
Implementation Reference
- src/services/matomo-api.ts:41-44 (handler)Core handler function that makes the API call to retrieve site information from Matomo using SitesManager.getSiteFromIdasync getSite(siteId: number): Promise<MatomoSite> { const response = await this.makeRequest('SitesManager.getSiteFromId', { idSite: siteId }); return response; }
- src/index.ts:346-360 (handler)MCP server wrapper handler for matomo_get_site tool, checks connection and formats response from serviceprivate async handleGetSite(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 site = await this.matomoService.getSite(args.siteId); return { content: [ { type: 'text', text: `Thông tin site:\n${JSON.stringify(site, null, 2)}`, }, ], }; }
- src/index.ts:66-78 (schema)Input schema definition for the matomo_get_site tool, specifying siteId as required numbername: 'matomo_get_site', description: 'Lấy thông tin chi tiết của một site', inputSchema: { type: 'object', properties: { siteId: { type: 'number', description: 'ID của site cần lấy thông tin', }, }, required: ['siteId'], }, },
- src/index.ts:259-260 (registration)Registration of the tool handler in the CallToolRequest switch statementcase 'matomo_get_site': return await this.handleGetSite(args as { siteId: number });