analytics-chart-detail
Fetch and visualize detailed analytics from A/B test charts by providing chart ID and type using the hackle-mcp server's tool.
Instructions
fetch analytics chart detail. You can visualize the chart using this tool's result.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chartId | Yes | Chart id | |
| chartType | Yes | Type of the chart. Will throw an error if given chartId's chart type is different from chartType. |
Implementation Reference
- src/index.ts:300-311 (handler)The handler function for the 'analytics-chart-detail' tool. It constructs a query string with chartType, fetches the chart details from the API using WebClient.get, stringifies the JSON response, and returns it as text content.async ({ chartId, chartType }) => { const qs = stringify({ chartType }, { addQueryPrefix: true }); return { content: [ { type: 'text', text: JSON.stringify(await WebClient.get(`/api/v1/analytics/charts/${chartId}${qs}`)), }, ], }; },
- src/index.ts:294-299 (schema)Input schema defined using Zod: requires chartId (positive number) and chartType (one of FUNNEL, DATA_INSIGHT, RETENTION, USER_PATH).{ chartId: z.number().positive().describe('Chart id'), chartType: z .enum(['FUNNEL', 'DATA_INSIGHT', 'RETENTION', 'USER_PATH']) .describe("Type of the chart. Will throw an error if given chartId's chart type is different from chartType."), },
- src/index.ts:291-312 (registration)The server.tool call that registers the 'analytics-chart-detail' tool, providing the name, description, input schema, and inline handler function.server.tool( 'analytics-chart-detail', "fetch analytics chart detail. You can visualize the chart using this tool's result.", { chartId: z.number().positive().describe('Chart id'), chartType: z .enum(['FUNNEL', 'DATA_INSIGHT', 'RETENTION', 'USER_PATH']) .describe("Type of the chart. Will throw an error if given chartId's chart type is different from chartType."), }, async ({ chartId, chartType }) => { const qs = stringify({ chartType }, { addQueryPrefix: true }); return { content: [ { type: 'text', text: JSON.stringify(await WebClient.get(`/api/v1/analytics/charts/${chartId}${qs}`)), }, ], }; }, );