Skip to main content
Glama
DumplingAI

Dumpling AI MCP Server

Official
by DumplingAI

generate-agent-completion

Generate AI text completions using customizable parameters like agent selection and conversation history for tailored responses.

Instructions

Generate AI text completions with customizable parameters.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messagesYesArray of messages
agentIdYesAgent ID
parseJsonNoParse response as JSON
threadIdNoThread ID for conversation history

Implementation Reference

  • The async handler function that executes the tool logic by making a POST request to the external Dumpling AI API endpoint `/api/v1/agents/generate-completion` with the provided parameters and returns the JSON response formatted as MCP content.
    async ({ messages, agentId, parseJson, threadId }) => {
      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/agents/generate-completion`,
        {
          method: "POST",
          headers: {
            "Content-Type": "application/json",
            Authorization: `Bearer ${apiKey}`,
          },
          body: JSON.stringify({ messages, agentId, parseJson, threadId }),
        }
      );
      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: messages (array of role/content objects), agentId (string), parseJson (optional boolean), threadId (optional string).
    {
      messages: z
        .array(
          z.object({ role: z.enum(["user", "assistant"]), content: z.string() })
        )
        .describe("Array of messages"),
      agentId: z.string().describe("Agent ID"),
      parseJson: z.boolean().optional().describe("Parse response as JSON"),
      threadId: z
        .string()
        .optional()
        .describe("Thread ID for conversation history"),
    },
  • src/index.ts:857-892 (registration)
    The server.tool registration call that defines and registers the 'generate-agent-completion' tool with its name, description, input schema, and handler function.
    server.tool(
      "generate-agent-completion",
      "Generate AI text completions with customizable parameters.",
      {
        messages: z
          .array(
            z.object({ role: z.enum(["user", "assistant"]), content: z.string() })
          )
          .describe("Array of messages"),
        agentId: z.string().describe("Agent ID"),
        parseJson: z.boolean().optional().describe("Parse response as JSON"),
        threadId: z
          .string()
          .optional()
          .describe("Thread ID for conversation history"),
      },
      async ({ messages, agentId, parseJson, threadId }) => {
        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/agents/generate-completion`,
          {
            method: "POST",
            headers: {
              "Content-Type": "application/json",
              Authorization: `Bearer ${apiKey}`,
            },
            body: JSON.stringify({ messages, agentId, parseJson, threadId }),
          }
        );
        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. It mentions 'customizable parameters' but doesn't disclose critical behavioral traits such as rate limits, authentication needs, response format, or potential side effects. For an AI generation tool with no annotations, this leaves significant gaps in understanding how the tool behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that clearly states the tool's function. It's appropriately sized and front-loaded with the core purpose. There's no wasted verbiage, though it could benefit from additional context to improve completeness.

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 an AI text generation tool with no annotations and no output schema, the description is insufficient. It lacks details on response format, error handling, or how it integrates with sibling tools. The agent would struggle to use this effectively without more context about its behavior and outputs.

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%, with all parameters documented in the schema. The description adds no specific meaning beyond the schema's details about messages, agentId, parseJson, and threadId. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description doesn't enhance parameter understanding.

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

Purpose3/5

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

The description states the tool 'Generate AI text completions with customizable parameters' which provides a clear verb ('Generate') and resource ('AI text completions'), but it doesn't distinguish from sibling tools like 'get-autocomplete' or 'search' which might also generate text. The purpose is understandable but lacks differentiation from similar tools in the server.

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 'get-autocomplete' or other AI-related tools. There's no mention of specific contexts, prerequisites, or exclusions. The agent must infer usage from the tool name and parameters alone.

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