Skip to main content
Glama
DumplingAI

Dumpling AI MCP Server

Official
by DumplingAI

add-to-knowledge-base

Enhance your knowledge base by adding new text resources with ease. Specify the knowledge base ID, resource name, and content to update and organize information effectively.

Instructions

Add new text resources to a knowledge base.

Input Schema

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

Implementation Reference

  • src/index.ts:925-949 (registration)
    Registration of the 'add-to-knowledge-base' tool using McpServer.tool, including inline schema and handler.
    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) }] }; } );
  • Input schema using Zod for knowledgeBaseId (string), name (string), and content (string).
    { knowledgeBaseId: z.string().describe("Knowledge base ID"), name: z.string().describe("Resource name"), content: z.string().describe("Text content to add"), },
  • Handler function that authenticates with DUMPLING_API_KEY and POSTs to the Dumpling AI API endpoint to add the resource to the knowledge base, returning the API response as text content.
    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) }] }; }

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