create_report
Create and save a new analytics report for a website. Specify report name, type (funnel, retention, utm, goals, insights, revenue, journey, attribution), and parameters to customize tracking and analysis.
Instructions
Create and save a new report
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| websiteId | Yes | Website UUID | |
| name | Yes | Report name | |
| type | Yes | Report type | |
| description | No | Report description | |
| parameters | No | Report-specific parameters (JSON object) |
Implementation Reference
- src/tools/reports.ts:36-57 (handler)The handler function for the 'create_report' tool. It takes websiteId, name, type, description, and parameters as input, builds a body object, and calls POST /api/reports via the UmamiClient.
server.tool( "create_report", "Create and save a new report", { websiteId: z.string().describe("Website UUID"), name: z.string().describe("Report name"), type: z .enum(["funnel", "retention", "utm", "goals", "insights", "revenue", "journey", "attribution"]) .describe("Report type"), description: z.string().optional().describe("Report description"), parameters: z .record(z.unknown()) .optional() .describe("Report-specific parameters (JSON object)"), }, async ({ websiteId, name, type, description, parameters }) => { const body: Record<string, unknown> = { websiteId, name, type }; if (description) body.description = description; if (parameters) body.parameters = parameters; const data = await client.call("POST", "/api/reports", body); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } - src/tools/reports.ts:39-50 (schema)The input schema for 'create_report' using Zod. Defines required fields: websiteId (string), name (string), type (enum of 8 specific values), and optional fields: description (string) and parameters (record of unknown).
{ websiteId: z.string().describe("Website UUID"), name: z.string().describe("Report name"), type: z .enum(["funnel", "retention", "utm", "goals", "insights", "revenue", "journey", "attribution"]) .describe("Report type"), description: z.string().optional().describe("Report description"), parameters: z .record(z.unknown()) .optional() .describe("Report-specific parameters (JSON object)"), }, - src/tools/reports.ts:36-58 (registration)The 'create_report' tool is registered via server.tool() inside the registerReportTools function in src/tools/reports.ts.
server.tool( "create_report", "Create and save a new report", { websiteId: z.string().describe("Website UUID"), name: z.string().describe("Report name"), type: z .enum(["funnel", "retention", "utm", "goals", "insights", "revenue", "journey", "attribution"]) .describe("Report type"), description: z.string().optional().describe("Report description"), parameters: z .record(z.unknown()) .optional() .describe("Report-specific parameters (JSON object)"), }, async ({ websiteId, name, type, description, parameters }) => { const body: Record<string, unknown> = { websiteId, name, type }; if (description) body.description = description; if (parameters) body.parameters = parameters; const data = await client.call("POST", "/api/reports", body); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } ); - src/index.ts:33-33 (registration)The registerReportTools function (which registers 'create_report') is called from the main entry point src/index.ts.
registerReportTools(server, client); - src/index.ts:76-76 (registration)The registerReportTools function is also called in the createSandboxServer function for the Smithery sandbox environment.
registerReportTools(sandbox, mockClient);