Skip to main content
Glama
alcylu

Nightlife Search

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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
genresYes

Implementation Reference

  • 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 ?? [] };
    }
  • 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(),
        }),
      ),
    });
  • 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),
        ),
    );
  • 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,
        },
      },
    },
  • 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"],
    },
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description implies a read-only, non-destructive operation by stating 'list all available genres.' This is adequate for a simple list tool, though it could explicitly mention safety (e.g., no side effects).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, no wasted words. The first sentence states the purpose, the second gives practical usage advice. Front-loaded and efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no parameters and a simple output (presumably a list of strings), the description is complete. It covers what the tool does and why to use it. No additional details are necessary.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist in the input schema, and schema description coverage is 100%. The baseline for zero parameters is 4, and the description adds no param info, which is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('list all available genres') and the resource ('genres'). It distinguishes from sibling tools like search_events or search_venues by focusing on genre discovery, not filtering or event retrieval.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly advises using this tool before filtering events or venues, providing clear context. While it doesn't list what not to use or alternatives, the guidance is sufficient for this simple tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/alcylu/nightlife-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server