Skip to main content
Glama

kobold_complete

Generate text completions using KoboldAI's language model through an OpenAI-compatible API endpoint for applications requiring AI-powered text generation.

Instructions

Text completion (OpenAI-compatible)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiUrlNohttp://localhost:5001
promptYes
max_tokensNo
temperatureNo
top_pNo
stopNo

Implementation Reference

  • Generic handler for all POST-based tools, including kobold_complete. Validates input using the tool's schema, forwards the request to the KoboldAI API endpoint via makeRequest, and returns the JSON response.
    if (postEndpoints[name]) {
        const { endpoint, schema } = postEndpoints[name];
        const parsed = schema.safeParse(args);
        if (!parsed.success) {
            throw new Error(`Invalid arguments: ${parsed.error}`);
        }
    
        const result = await makeRequest(`${apiUrl}${endpoint}`, 'POST', requestData);
        return {
            content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
            isError: false,
        };
  • Zod schema defining the input parameters for the kobold_complete tool, including prompt, max_tokens, temperature, top_p, and stop sequences.
    const CompletionSchema = BaseConfigSchema.extend({
        prompt: z.string(),
        max_tokens: z.number().optional(),
        temperature: z.number().optional(),
        top_p: z.number().optional(),
        stop: z.array(z.string()).optional(),
    });
  • src/index.ts:266-268 (registration)
    Registers the kobold_complete tool in the ListTools response, providing its name, description, and input schema.
    name: "kobold_complete",
    description: "Text completion (OpenAI-compatible)",
    inputSchema: zodToJsonSchema(CompletionSchema),
  • Maps the kobold_complete tool to its KoboldAI API endpoint '/v1/completions' and references the input schema for validation.
    kobold_complete: { endpoint: '/v1/completions', schema: CompletionSchema },
  • Utility function that performs HTTP requests to the KoboldAI API, used by the tool handler to proxy requests and handle responses.
    async function makeRequest(url: string, method = 'GET', body: Record<string, unknown> | null = null) {
        const options: RequestInit = {
            method,
            headers: body ? { 'Content-Type': 'application/json' } : undefined,
        };
        
        if (body && method !== 'GET') {
            options.body = JSON.stringify(body);
        }
    
        const response = await fetch(url, options);
        if (!response.ok) {
            throw new Error(`KoboldAI API error: ${response.statusText}`);
        }
        
        return response.json();
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It only states the basic function and compatibility, missing critical information like whether this is a read-only operation, what authentication is required, rate limits, response format, or error behavior. For a tool with 6 parameters and no annotations, this is insufficient.

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 at just 4 words, with zero wasted language. It's front-loaded with the core function and includes important compatibility information. Every word earns its place in this minimal description.

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?

For a text completion tool with 6 parameters, no annotations, no output schema, and 0% schema description coverage, the description is inadequate. It doesn't explain what the tool returns, how to interpret parameters, or provide any behavioral context. The OpenAI-compatibility hint is helpful but insufficient for the tool's complexity.

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?

With 0% schema description coverage for all 6 parameters, the description provides no information about what apiUrl, prompt, max_tokens, temperature, top_p, or stop mean. The description doesn't compensate for this complete lack of parameter documentation in the schema, leaving all parameters semantically undefined.

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 'Text completion (OpenAI-compatible)' clearly states the tool's function as text completion and provides important context about API compatibility. It distinguishes itself from siblings like kobold_chat (likely conversational) and kobold_generate (potentially broader generation), though it doesn't explicitly contrast with them.

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?

No guidance is provided about when to use this tool versus alternatives like kobold_chat or kobold_generate. The description mentions OpenAI-compatibility which implies usage patterns, but doesn't explicitly state when this tool is appropriate versus other completion/generation tools in the sibling list.

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/PhialsBasement/KoboldCPP-MCP-Server'

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