Skip to main content
Glama
alcylu

Nightlife Search

list_areas

Retrieve distinct neighborhood names for any city to use as valid area filters.

Instructions

List distinct area/neighborhood names for a given city. Use this to discover valid area filters.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cityNoCity slug (defaults to tokyo)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
cityYes
areasYes

Implementation Reference

  • Core handler for list_areas: queries the venues table for a given city, deduplicates area names from city_en/city/city_ja columns, and returns sorted unique areas.
    export async function listAreas(
      supabase: SupabaseClient,
      config: AppConfig,
      citySlug?: string,
    ): Promise<{ city: string; areas: string[] }> {
      const slug = citySlug?.trim().toLowerCase() || config.defaultCity;
    
      const cityCtx = await getCityContext(supabase, slug, config.defaultCountryCode);
      if (!cityCtx) {
        throw new NightlifeError("INVALID_REQUEST", `City not found: ${slug}`);
      }
    
      const { data, error } = await supabase
        .from("venues")
        .select("city_en,city,city_ja")
        .eq("city_id", cityCtx.id);
    
      if (error) {
        throw new NightlifeError("INTERNAL_ERROR", `Failed to fetch areas: ${error.message}`);
      }
    
      const seen = new Set<string>();
      const areas: string[] = [];
    
      for (const row of (data ?? []) as VenueAreaRow[]) {
        const raw = row.city_en || row.city || row.city_ja;
        if (!raw) continue;
        const normalized = raw.trim().toLowerCase();
        if (normalized && !seen.has(normalized)) {
          seen.add(normalized);
          areas.push(raw.trim());
        }
      }
    
      areas.sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase()));
    
      return { city: cityCtx.slug, areas };
    }
  • Zod output schema for list_areas: an object with 'city' (string) and 'areas' (string array).
    const listAreasOutputSchema = z.object({
      city: z.string(),
      areas: z.array(z.string()),
    });
  • MCP tool registration for 'list_areas' via registerHelperTools(), defining description, input schema (optional city slug), output schema, and handler that calls listAreas().
    server.registerTool(
      "list_areas",
      {
        description:
          "List distinct area/neighborhood names for a given city. Use this to discover valid area filters.",
        inputSchema: {
          city: z
            .string()
            .optional()
            .describe("City slug (defaults to tokyo)"),
        },
        outputSchema: listAreasOutputSchema,
      },
      async ({ city }) =>
        runTool("list_areas", listAreasOutputSchema, async () =>
          listAreas(deps.supabase, deps.config, city),
        ),
    );
  • src/server.ts:36-36 (registration)
    Top-level registration: registerHelperTools(server, {config, supabase}) called in createNightlifeServer().
    registerHelperTools(server, { config, supabase });
  • REST endpoint GET /api/v1/areas that also calls listAreas(), providing the same functionality via HTTP.
    // GET /api/v1/areas
    router.get("/areas", async (req, res) => {
      try {
        const result = await listAreas(supabase, config, str(req.query.city));
        res.json(result);
      } catch (error) {
        sendError(res, error);
      }
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavioral traits. It only states the function without detailing ordering, pagination, error handling, or side effects. This is insufficient for a tool with no annotations.

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?

The description consists of two concise sentences that front-load the purpose. Every word contributes, and there is no redundancy or unnecessary detail.

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

Completeness3/5

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

The description is adequate for a simple tool with one optional parameter and an output schema. However, it omits mention of the default city ('tokyo') and does not hint at the output structure or any filtering behavior, which would improve completeness.

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

Parameters3/5

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

Schema coverage is 100% with both parameter and description provided. The description does not add meaning beyond the schema; it simply reiterates 'for a given city'. Baseline of 3 is appropriate given high schema coverage.

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 'List distinct area/neighborhood names for a given city', specifying the verb 'list' and the resource 'area/neighborhood names'. It distinguishes from sibling tools like list_cities, which lists cities. This is a specific and helpful purpose statement.

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

Usage Guidelines3/5

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

The description says 'Use this to discover valid area filters', indicating when to use the tool. However, it does not provide exclusions or alternatives, such as noting that list_cities should be used for city-level queries. Guidance is minimal but present.

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