Skip to main content
Glama
Eyalm321

multilingual-dictionary-mcp

by Eyalm321

dictionary_hypernyms

Retrieve hypernyms (broader concepts) for any word using offline ConceptNet. Supports multiple languages and adjustable result limits.

Instructions

Hypernyms (broader concepts) via offline ConceptNet IsA. E.g. dog -> mammal.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
wordYes
languageNoen
limitNo

Implementation Reference

  • Handler for dictionary_hypernyms tool. Delegates to fetchRelation with 'IsA' relation and direction 'start' (i.e., broader concepts where the query word is the start/child).
    handler: async (args: { word: string; language?: string; limit?: number }) =>
      fetchRelation(args.word, args.language ?? "en", "IsA", args.limit ?? 50, "start"),
  • Input schema for dictionary_hypernyms: word (string, required), language (string, default 'en'), limit (int 1-1000, default 50).
    inputSchema: z.object({
      word: z.string(),
      language: z.string().default("en"),
      limit: z.number().int().min(1).max(1000).default(50),
    }),
  • Tool definition object for dictionary_hypernyms within the relationTools array. Registered with name, description, inputSchema, and handler.
    {
      name: "dictionary_hypernyms",
      description: "Hypernyms (broader concepts) via offline ConceptNet IsA. E.g. dog -> mammal.",
      inputSchema: z.object({
        word: z.string(),
        language: z.string().default("en"),
        limit: z.number().int().min(1).max(1000).default(50),
      }),
      handler: async (args: { word: string; language?: string; limit?: number }) =>
        fetchRelation(args.word, args.language ?? "en", "IsA", args.limit ?? 50, "start"),
  • fetchRelation helper function called by dictionary_hypernyms handler. Queries local ConceptNet SQLite edges filtered by relation type 'IsA' and direction 'start'.
    function fetchRelation(
      word: string,
      language: string,
      rel: string,
      limit: number,
      direction: "start" | "end" | "any" = "any"
    ): RelationResult[] {
      const local = localConceptNetEdges({ word, language, rel, direction, limit });
      if (local === undefined) {
        throw new Error(
          `ConceptNet relation lookup needs the offline data. Install state: ${dataInstallSummary()}. Use dictionary_status to track progress.`
        );
      }
      return local.map((e) => localEdgeToResult(e, word, language));
    }
  • localConceptNetEdges function that queries the ConceptNet SQLite database. Called by fetchRelation with the 'IsA' relation to retrieve hypernym edges.
    export function localConceptNetEdges(opts: {
      word: string;
      language: string;
      rel?: string;
      direction?: "start" | "end" | "any";
      otherLanguage?: string;
      limit: number;
    }): LocalEdge[] | undefined {
      const db = conceptnetDb();
      if (!db) return undefined;
      const node = `/c/${opts.language}/${normalizeWord(opts.word)}`;
      const direction = opts.direction ?? "any";
      const where: string[] = [];
      const params: unknown[] = [];
      if (direction === "start" || direction === "any") {
        where.push("start_uri = ?");
        params.push(node);
      }
      if (direction === "end") {
        where.push("end_uri = ?");
        params.push(node);
      }
      let whereSql = direction === "any" ? "(start_uri = ? OR end_uri = ?)" : where.join(" AND ");
      let actualParams: unknown[] = direction === "any" ? [node, node] : params;
      if (opts.rel) {
        whereSql += " AND rel = ?";
        actualParams.push(opts.rel);
      }
      if (opts.otherLanguage) {
        whereSql += " AND (start_lang = ? OR end_lang = ?)";
        actualParams.push(opts.otherLanguage, opts.otherLanguage);
      }
      const rows = db
        .prepare(
          `SELECT rel, start_uri, end_uri, start_lang, end_lang, start_label, end_label, weight, surface_text
           FROM edges
           WHERE ${whereSql}
           ORDER BY weight DESC
           LIMIT ?`
        )
        .all(...actualParams, opts.limit) as Array<{
        rel: string;
        start_uri: string;
        end_uri: string;
        start_lang: string;
        end_lang: string;
        start_label: string;
        end_label: string;
        weight: number;
        surface_text: string | null;
      }>;
      return rows.map((r) => ({
        rel: r.rel,
        start: r.start_uri,
        end: r.end_uri,
        startLang: r.start_lang,
        endLang: r.end_lang,
        startLabel: r.start_label,
        endLabel: r.end_label,
        weight: r.weight,
        surfaceText: r.surface_text,
      }));
    }
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that the lookup is offline ('via offline ConceptNet IsA'), which is useful. However, it doesn't mention behavior for missing words, rate limits, or other potential issues. Given the simplicity, minimal disclosure is acceptable.

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 is extremely concise: a single sentence plus an example. No filler or redundant information. Every part earns its place.

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

Completeness4/5

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

Given the tool's simplicity (3 straightforward parameters, no output schema), the description provides the essential purpose and an example. It is fairly complete for an agent to understand and invoke the tool correctly, though additional info on language/limit would improve completeness.

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

Parameters2/5

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

Schema coverage is 0%, and the description adds no parameter details beyond an example that implies the 'word' parameter. It does not explain 'language', 'limit', or their defaults/ranges. The example is helpful but insufficient to fully compensate for the lack of schema descriptions.

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 that the tool returns hypernyms (broader concepts) using offline ConceptNet IsA, with a concrete example ('dog -> mammal'). This distinguishes it from sibling tools like hyponyms, synonyms, etc.

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?

The description implicitly indicates when to use (when broader concepts are needed) via the term 'hypernyms' and the example, but does not explicitly state when not to use or name alternative tools. Still, it is clear enough for an agent familiar with the domain.

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/Eyalm321/multilingual-dictionary-mcp'

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