list_genres
List all available genres to identify valid genre names for filtering events or venues.
Instructions
List all available genres. Use this to discover valid genre names before filtering events or venues.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| genres | Yes |
Implementation Reference
- src/services/helpers.ts:6-28 (handler)The actual handler function 'listGenres' that queries the 'genres' table via Supabase and returns genre data (id, name, name_en, name_ja).
// --- list_genres --- type GenreRow = { id: string; name: string; name_en: string | null; name_ja: string | null; }; export async function listGenres( supabase: SupabaseClient, ): Promise<{ genres: GenreRow[] }> { const { data, error } = await supabase .from("genres") .select("id,name,name_en,name_ja") .order("name", { ascending: true }); if (error) { throw new NightlifeError("INTERNAL_ERROR", `Failed to fetch genres: ${error.message}`); } return { genres: data ?? [] }; } - src/tools/helpers.ts:66-75 (schema)Zod schema 'listGenresOutputSchema' defining the output shape: an array of genres with id, name, name_en, name_ja fields.
const listGenresOutputSchema = z.object({ genres: z.array( z.object({ id: z.string(), name: z.string(), name_en: z.string().nullable(), name_ja: z.string().nullable(), }), ), }); - src/tools/helpers.ts:99-111 (registration)MCP tool registration for 'list_genres' using server.registerTool with the schema and a handler that calls the listGenres service.
server.registerTool( "list_genres", { description: "List all available genres. Use this to discover valid genre names before filtering events or venues.", inputSchema: {}, outputSchema: listGenresOutputSchema, }, async () => runTool("list_genres", listGenresOutputSchema, async () => listGenres(deps.supabase), ), ); - src/openapi.ts:321-336 (schema)OpenAPI spec for the GET /genres endpoint with operationId 'listGenres', referencing the ListGenresOutput schema.
"/genres": { get: { summary: "List genres", description: "List all available genres. Use this to discover valid genre names before filtering events or venues.", operationId: "listGenres", tags: ["Helpers"], parameters: [], responses: { "200": { description: "List of available genres", content: { "application/json": { schema: { $ref: "#/components/schemas/ListGenresOutput" } } }, }, "401": auth401, }, }, }, - src/openapi.ts:638-656 (schema)OpenAPI schema definition for 'ListGenresOutput' specifying the JSON response shape (array of genres with id, name, name_en, name_ja).
ListGenresOutput: { type: "object", properties: { genres: { type: "array", items: { type: "object", properties: { id: { type: "string" }, name: { type: "string" }, name_en: { type: ["string", "null"] }, name_ja: { type: ["string", "null"] }, }, required: ["id", "name", "name_en", "name_ja"], }, }, }, required: ["genres"], },