List REST endpoints
list_endpointsList ProsodyAI REST API endpoints from the bundled OpenAPI spec. Filter by tag or path substring to find specific endpoints.
Instructions
List ProsodyAI REST API endpoints from the bundled OpenAPI spec. Optional filters by tag or path substring.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tag | No | Filter by OpenAPI tag (e.g. `Analysis`, `Sessions`). | |
| pathContains | No | Substring filter on the URL path (e.g. `analyze`). |
Implementation Reference
- src/lib/openapi.ts:44-69 (handler)Core handler: async function listEndpoints() that loads the OpenAPI spec, iterates over paths/methods, applies optional tag/pathContains filters, and returns a sorted array of EndpointSummary objects.
export async function listEndpoints(filter?: { tag?: string; pathContains?: string; }): Promise<EndpointSummary[]> { const spec = await loadOpenApi(); if (!spec?.paths) return []; const out: EndpointSummary[] = []; for (const [path, methods] of Object.entries(spec.paths)) { for (const [method, op] of Object.entries(methods)) { if (!["get", "post", "put", "patch", "delete", "options", "head"].includes(method)) continue; const summary: EndpointSummary = { method: method.toUpperCase(), path, operationId: op.operationId, summary: op.summary, tags: op.tags, }; if (filter?.tag && !(op.tags ?? []).includes(filter.tag)) continue; if (filter?.pathContains && !path.toLowerCase().includes(filter.pathContains.toLowerCase())) continue; out.push(summary); } } return out.sort((a, b) => a.path === b.path ? a.method.localeCompare(b.method) : a.path.localeCompare(b.path), ); } - src/lib/openapi.ts:36-42 (schema)Type definition: EndpointSummary interface describing the shape of each returned endpoint (method, path, operationId, summary, tags).
export interface EndpointSummary { method: string; path: string; operationId?: string; summary?: string; tags?: string[]; }