list_reports
Retrieve and display available advertising campaign reports from Kayzen Analytics to access performance data and insights for analysis.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:31-54 (handler)The handler and registration for the 'list_reports' MCP tool. It defines an empty input schema, executes kayzenClient.listReports(), formats the result as JSON text content, and handles errors by returning an error message.server.tool( "list_reports", {}, async () => { try { const result = await kayzenClient.listReports() as ReportListResponse; return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [{ type: "text", text: `Error listing reports: ${errorMessage}` }], isError: true }; } } );
- src/server.ts:17-23 (schema)TypeScript interface used to type the response from the listReports API call in the handler.interface ReportListResponse { reports: Array<{ id: string; name: string; type: string; }>; }
- src/kayzen-client.ts:90-92 (helper)Supporting method in KayzenClient class that makes the authenticated GET request to the '/reports' endpoint to fetch the list of reports.async listReports() { return this.makeRequest('GET', '/reports'); }