Skip to main content
Glama
DumplingAI

Dumpling AI MCP Server

Official
by DumplingAI

search-knowledge-base

Find relevant information by searching a knowledge base with specific queries and result counts.

Instructions

Search a knowledge base for relevant information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
knowledgeBaseIdYesKnowledge base ID
queryYesSearch query
resultCountNoNumber of results

Implementation Reference

  • Handler function that sends a POST request to the external API endpoint `/api/v1/query-knowledge-base` using the DUMPLING_API_KEY for authentication, and returns the response as formatted JSON text.
    async ({ knowledgeBaseId, query, resultCount }) => {
      const apiKey = process.env.DUMPLING_API_KEY;
      if (!apiKey) throw new Error("DUMPLING_API_KEY not set");
      const response = await fetch(
        `${NWS_API_BASE}/api/v1/query-knowledge-base`,
        {
          method: "POST",
          headers: {
            "Content-Type": "application/json",
            Authorization: `Bearer ${apiKey}`,
          },
          body: JSON.stringify({ knowledgeBaseId, query, resultCount }),
        }
      );
      if (!response.ok)
        throw new Error(`Failed: ${response.status} ${await response.text()}`);
      const data = await response.json();
      return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
    }
  • Zod schema defining the input parameters: knowledgeBaseId (required string), query (required string), resultCount (optional number with default 5).
    {
      knowledgeBaseId: z.string().describe("Knowledge base ID"),
      query: z.string().describe("Search query"),
      resultCount: z.number().optional().default(5).describe("Number of results"),
    },
  • src/index.ts:895-922 (registration)
    Registration of the 'search-knowledge-base' tool using server.tool(), including name, description, input schema, and inline handler function.
    server.tool(
      "search-knowledge-base",
      "Search a knowledge base for relevant information.",
      {
        knowledgeBaseId: z.string().describe("Knowledge base ID"),
        query: z.string().describe("Search query"),
        resultCount: z.number().optional().default(5).describe("Number of results"),
      },
      async ({ knowledgeBaseId, query, resultCount }) => {
        const apiKey = process.env.DUMPLING_API_KEY;
        if (!apiKey) throw new Error("DUMPLING_API_KEY not set");
        const response = await fetch(
          `${NWS_API_BASE}/api/v1/query-knowledge-base`,
          {
            method: "POST",
            headers: {
              "Content-Type": "application/json",
              Authorization: `Bearer ${apiKey}`,
            },
            body: JSON.stringify({ knowledgeBaseId, query, resultCount }),
          }
        );
        if (!response.ok)
          throw new Error(`Failed: ${response.status} ${await response.text()}`);
        const data = await response.json();
        return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
      }
    );
Behavior2/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 of behavioral disclosure. It states the tool searches for 'relevant information' but doesn't explain what 'relevant' means (e.g., ranking, filtering, or relevance algorithms), whether it's read-only (implied but not explicit), or any limitations like rate limits or authentication needs. This leaves significant gaps for an agent to understand how the tool behaves beyond basic functionality.

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 a single, efficient sentence with no wasted words: 'Search a knowledge base for relevant information.' It's front-loaded and appropriately sized for the tool's complexity, making it easy for an agent to parse quickly.

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

Completeness2/5

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

Given the complexity of a search tool with no annotations and no output schema, the description is incomplete. It doesn't cover behavioral aspects (e.g., how results are returned, error handling) or usage context, leaving the agent with insufficient information to fully understand the tool's operation and limitations in this server environment.

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?

The schema description coverage is 100%, meaning all parameters are documented in the schema itself. The description doesn't add any additional meaning beyond what's in the schema (e.g., it doesn't explain how the query is processed or what the knowledgeBaseId refers to). With high schema coverage, the baseline score is 3, as the description doesn't compensate but also doesn't detract.

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

Purpose4/5

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

The description clearly states the tool's purpose as 'Search a knowledge base for relevant information,' which includes a specific verb ('search') and resource ('knowledge base'). It distinguishes from some siblings like 'add-to-knowledge-base' (which creates content) but doesn't explicitly differentiate from other search tools like 'search' or 'search-news' that might have overlapping functionality.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to prefer this over other search tools (e.g., 'search', 'search-news') or when it's appropriate given the context of knowledge bases. There's no information about prerequisites, such as needing an existing knowledge base or specific access rights.

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/DumplingAI/mcp-server-dumplingai'

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