List Goals
rybbit_list_goalsRetrieve all goals for a website with current conversion metrics and configuration details to analyze performance.
Instructions
List all goals for a site with their current conversion metrics and configuration.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| siteId | Yes | Site ID (numeric ID or domain identifier) | |
| startDate | No | Start date (YYYY-MM-DD) | |
| endDate | No | End date (YYYY-MM-DD) | |
| timeZone | No | IANA timezone (default UTC) | |
| filters | No | Filters to apply | |
| pastMinutesStart | No | Minutes ago start | |
| pastMinutesEnd | No | Minutes ago end |
Implementation Reference
- src/tools/goals.ts:20-59 (registration)Registration of the 'rybbit_list_goals' tool.
server.registerTool( "rybbit_list_goals", { title: "List Goals", description: "List all goals for a site with their current conversion metrics and configuration.", annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true, destructiveHint: false, }, inputSchema: { siteId: siteIdSchema, startDate: z .string() .optional() .describe("Start date (YYYY-MM-DD)"), endDate: z .string() .optional() .describe("End date (YYYY-MM-DD)"), timeZone: z .string() .optional() .describe("IANA timezone (default UTC)"), filters: z .array(filterSchema) .optional() .describe("Filters to apply"), pastMinutesStart: z .number() .optional() .describe("Minutes ago start"), pastMinutesEnd: z .number() .optional() .describe("Minutes ago end"), }, }, - src/tools/goals.ts:60-92 (handler)Handler implementation for 'rybbit_list_goals'.
async (args) => { try { const { siteId, ...rest } = args as { siteId: string; startDate?: string; endDate?: string; timeZone?: string; filters?: Array<{ parameter: string; type: string; value: (string | number)[]; }>; pastMinutesStart?: number; pastMinutesEnd?: number; }; const params = client.buildAnalyticsParams(rest); const data = await client.get<Goal[]>( `/sites/${siteId}/goals`, params ); return { content: [{ type: "text" as const, text: truncateResponse(data) }], }; } catch (err) { const message = err instanceof Error ? err.message : String(err); return { content: [{ type: "text" as const, text: `Error: ${message}` }], isError: true, }; } }