Skip to main content
Glama

kobold_generate

Generate text content using KoboldAI's language model by providing prompts and adjusting parameters like length, temperature, and context.

Instructions

Generate text with KoboldAI

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiUrlNohttp://localhost:5001
promptYes
max_lengthNo
max_context_lengthNo
temperatureNo
top_pNo
top_kNo
repetition_penaltyNo
stop_sequenceNo
seedNo

Implementation Reference

  • Handler logic for POST-based tools like kobold_generate: validates arguments using the tool's schema, then forwards the request via HTTP POST to the specified KoboldAI API endpoint 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_generate tool, including prompt and various generation options.
    const GenerateSchema = BaseConfigSchema.extend({
        prompt: z.string(),
        max_length: z.number().optional(),
        max_context_length: z.number().optional(),
        temperature: z.number().optional(),
        top_p: z.number().optional(),
        top_k: z.number().optional(),
        repetition_penalty: z.number().optional(),
        stop_sequence: z.array(z.string()).optional(),
        seed: z.number().optional(),
    });
  • src/index.ts:177-181 (registration)
    Tool registration in the listTools response, specifying name, description, and input schema.
    {
        name: "kobold_generate",
        description: "Generate text with KoboldAI",
        inputSchema: zodToJsonSchema(GenerateSchema),
    },
  • src/index.ts:332-332 (registration)
    Endpoint mapping for kobold_generate in the POST dispatch table, linking tool name to API path and schema.
    kobold_generate: { endpoint: '/api/v1/generate', schema: GenerateSchema },
  • Helper function that performs HTTP requests to the KoboldAI API, used by the tool handlers.
    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();
    }
Behavior1/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 only states 'Generate text with KoboldAI' without mentioning any behavioral traits such as rate limits, authentication needs, output format, or potential side effects. This leaves the agent with no insight into how the tool behaves beyond its basic function.

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 with a single sentence, 'Generate text with KoboldAI', which is front-loaded and wastes no words. It efficiently conveys the core purpose without unnecessary elaboration, though this brevity contributes to gaps in other dimensions.

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

Completeness1/5

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

Given the high complexity (10 parameters, 0% schema coverage, no annotations, no output schema), the description is completely inadequate. It doesn't explain parameter usage, behavioral context, or output expectations, leaving the agent ill-equipped to use this tool effectively in a server with many sibling tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 10 parameters and 0% schema description coverage, the description adds no meaning beyond the input schema. It doesn't explain what parameters like 'max_length', 'temperature', or 'stop_sequence' do, nor does it provide context for the required 'prompt' parameter. The description fails to compensate for the lack of schema documentation.

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 'Generate text with KoboldAI' states the basic action (generate text) and the system (KoboldAI), but it's vague about what type of text generation this provides compared to siblings like kobold_chat or kobold_complete. It doesn't specify if this is for story generation, completion, or another specific use case, leaving ambiguity.

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 on when to use this tool versus alternatives like kobold_chat or kobold_complete. The description offers no context, exclusions, or prerequisites, making it unclear how this tool differs from its siblings in the server 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