Skip to main content
Glama
DumplingAI

Dumpling AI MCP Server

Official
by DumplingAI

add-to-knowledge-base

Add text resources to a knowledge base for organizing and storing information within Dumpling AI's knowledge management system.

Instructions

Add new text resources to a knowledge base.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
knowledgeBaseIdYesKnowledge base ID
nameYesResource name
contentYesText content to add

Implementation Reference

  • Handler function that executes the tool by sending a POST request to the external API endpoint to add text resources to a specified knowledge base.
    async ({ knowledgeBaseId, name, content }) => {
      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/knowledge-bases/add`, {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          Authorization: `Bearer ${apiKey}`,
        },
        body: JSON.stringify({ knowledgeBaseId, name, content }),
      });
      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 for the tool: knowledgeBaseId, name, and content.
      knowledgeBaseId: z.string().describe("Knowledge base ID"),
      name: z.string().describe("Resource name"),
      content: z.string().describe("Text content to add"),
    },
  • src/index.ts:925-949 (registration)
    Registration of the 'add-to-knowledge-base' tool using server.tool(), including description, input schema, and handler function.
    server.tool(
      "add-to-knowledge-base",
      "Add new text resources to a knowledge base.",
      {
        knowledgeBaseId: z.string().describe("Knowledge base ID"),
        name: z.string().describe("Resource name"),
        content: z.string().describe("Text content to add"),
      },
      async ({ knowledgeBaseId, name, content }) => {
        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/knowledge-bases/add`, {
          method: "POST",
          headers: {
            "Content-Type": "application/json",
            Authorization: `Bearer ${apiKey}`,
          },
          body: JSON.stringify({ knowledgeBaseId, name, content }),
        });
        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 'Add' implies a write operation but doesn't cover permissions needed, rate limits, idempotency, or error handling. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 zero waste, clearly front-loading the core action. Every word earns its place, making it easy to parse quickly without unnecessary elaboration.

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 tool's complexity as a write operation with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits, return values, or error cases, leaving gaps that could hinder an AI agent's ability to use it correctly in context.

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 description coverage is 100%, so the schema already documents all three parameters (knowledgeBaseId, name, content) with basic descriptions. The description adds no additional meaning beyond what the schema provides, such as format examples or constraints, but doesn't contradict it either, meeting the baseline for high coverage.

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 action ('Add') and resource ('new text resources to a knowledge base'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'search-knowledge-base' or specify what types of text resources are supported beyond the generic term.

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 like 'search-knowledge-base' or other content-adding tools in the sibling list. It lacks context about prerequisites, such as needing an existing knowledge base, or exclusions, like not handling non-text resources.

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