Skip to main content
Glama
Hug0x0

mcp-reunion

reunion_search_catalog

Search the La Réunion open data catalog by keywords, theme, or publisher to find datasets not yet wired to dedicated tools.

Instructions

Search the full data.regionreunion.com catalog (~270 datasets) by keywords and/or theme. Use this to discover datasets that are not wired to a dedicated tool yet, then call reunion_inspect_dataset and reunion_query_dataset to work with them.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoFree-text search on titles, descriptions, keywords
themeNoTheme filter (prefix match), e.g. "Environnement", "Transports", "Éducation"
publisherNoPublisher filter (substring match)
limitNo

Implementation Reference

  • Handler function for the 'reunion_search_catalog' tool. Accepts optional query, theme, publisher, and limit parameters. Builds ODSQL conditions using buildWhere helper, calls client.listDatasets() to search the catalog, maps results to a structured response with dataset_id, title, description (stripped of HTML, truncated to 400 chars), theme, publisher, records_count, and modified. Returns total_matches and datasets array on success, or error on failure.
    async ({ query, theme, publisher, limit }) => {
      try {
        const conditions = buildWhere([
          query ? `search(${quote(query)})` : undefined,
          theme ? `theme LIKE ${quote(`${theme}%`)}` : undefined,
          publisher ? `publisher LIKE ${quote(`%${publisher}%`)}` : undefined,
        ]);
    
        const data = await client.listDatasets({ where: conditions, limit });
    
        return jsonResult({
          total_matches: data.total_count,
          datasets: data.results.map((row) => {
            const metas = (row.metas?.default ?? {}) as RecordObject;
            return {
              dataset_id: row.dataset_id,
              title: metas.title,
              description:
                typeof metas.description === 'string'
                  ? metas.description.replace(/<[^>]+>/g, '').slice(0, 400)
                  : undefined,
              theme: metas.theme,
              publisher: metas.publisher,
              records_count: metas.records_count,
              modified: metas.modified,
            };
          }),
        });
      } catch (error) {
        return errorResult(error instanceof Error ? error.message : 'Failed to search catalog');
      }
    }
  • Input schema for reunion_search_catalog tool: query (optional free-text string), theme (optional string for prefix-match filter), publisher (optional string for substring-match filter), limit (integer 1-100, defaults to 20).
    {
      query: z.string().optional().describe('Free-text search on titles, descriptions, keywords'),
      theme: z.string().optional().describe('Theme filter (prefix match), e.g. "Environnement", "Transports", "Éducation"'),
      publisher: z.string().optional().describe('Publisher filter (substring match)'),
      limit: z.number().int().min(1).max(100).default(20),
    },
  • Registration of the 'reunion_search_catalog' tool via server.tool() in the registerCatalogTools function. The tool description tells the LLM to search the full data.regionreunion.com catalog (~270 datasets) by keywords and/or theme, and hints at using reunion_inspect_dataset and reunion_query_dataset for further interaction.
    server.tool(
      'reunion_search_catalog',
      'Search the full data.regionreunion.com catalog (~270 datasets) by keywords and/or theme. Use this to discover datasets that are not wired to a dedicated tool yet, then call reunion_inspect_dataset and reunion_query_dataset to work with them.',
      {
        query: z.string().optional().describe('Free-text search on titles, descriptions, keywords'),
        theme: z.string().optional().describe('Theme filter (prefix match), e.g. "Environnement", "Transports", "Éducation"'),
        publisher: z.string().optional().describe('Publisher filter (substring match)'),
        limit: z.number().int().min(1).max(100).default(20),
      },
      async ({ query, theme, publisher, limit }) => {
        try {
          const conditions = buildWhere([
            query ? `search(${quote(query)})` : undefined,
            theme ? `theme LIKE ${quote(`${theme}%`)}` : undefined,
            publisher ? `publisher LIKE ${quote(`%${publisher}%`)}` : undefined,
          ]);
    
          const data = await client.listDatasets({ where: conditions, limit });
    
          return jsonResult({
            total_matches: data.total_count,
            datasets: data.results.map((row) => {
              const metas = (row.metas?.default ?? {}) as RecordObject;
              return {
                dataset_id: row.dataset_id,
                title: metas.title,
                description:
                  typeof metas.description === 'string'
                    ? metas.description.replace(/<[^>]+>/g, '').slice(0, 400)
                    : undefined,
                theme: metas.theme,
                publisher: metas.publisher,
                records_count: metas.records_count,
                modified: metas.modified,
              };
            }),
          });
        } catch (error) {
          return errorResult(error instanceof Error ? error.message : 'Failed to search catalog');
        }
      }
    );
  • registerCatalogTools(server) is called from registerAllTools() in src/modules/index.ts, which is invoked during server startup in src/index.ts.
    registerAdministrationTools(server);
    registerCatalogTools(server);
    registerCommuneTools(server);
  • buildWhere helper used by the handler to construct an ODSQL WHERE clause from an array of optional conditions, joining them with ' AND '.
    export function buildWhere(
      conditions: Array<string | undefined | null | false>
    ): string | undefined {
      const valid = conditions.filter((condition): condition is string => Boolean(condition));
      return valid.length > 0 ? valid.join(' AND ') : undefined;
    }
Behavior4/5

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

No annotations provided, so description carries full burden. It accurately describes a read operation (search catalog) and mentions scale (~270 datasets). Minor lack of detail on return structure, but sufficient for a search tool.

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 concise sentences: first states purpose, second provides usage flow. No redundant information, each sentence earns its place.

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 simple search tool with 4 parameters and no output schema, the description provides sufficient context: catalog size, usage flow, and link to follow-up tools. No gaps that hinder correct invocation.

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 descriptions cover 75% of parameters (query, theme, publisher) with clear explanations. The description only echoes 'keywords and/or theme' from schema, adding no significant new meaning beyond what schema already provides.

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 tool searches the full catalog (~270 datasets) by keywords and/or theme, and distinguishes itself from sibling tools by specifying it is for discovering datasets not covered by dedicated tools.

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

Usage Guidelines5/5

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

Explicitly states when to use (discover datasets not wired to a dedicated tool) and what to do next (call reunion_inspect_dataset and reunion_query_dataset), providing clear guidance on alternatives.

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/Hug0x0/mcp-reunion'

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