Skip to main content
Glama

kobold_max_length

Retrieve the maximum text generation length setting from KoboldAI's API to control output size and manage computational resources during AI-powered text creation.

Instructions

Get current max length setting

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiUrlNohttp://localhost:5001

Implementation Reference

  • Dispatches the kobold_max_length tool call by making a GET request to the KoboldAI API at /api/v1/config/max_length and returns the JSON response as text content.
    const getEndpoints: Record<string, string> = {
        kobold_max_context_length: '/api/v1/config/max_context_length',
        kobold_max_length: '/api/v1/config/max_length',
        kobold_generate_check: '/api/extra/generate/check',
        kobold_model_info: '/api/v1/model',
        kobold_version: '/api/v1/info/version',
        kobold_perf_info: '/api/extra/perf',
        kobold_sd_models: '/sdapi/v1/sd-models',
        kobold_sd_samplers: '/sdapi/v1/samplers',
    };
    
    if (getEndpoints[name]) {
        const result = await makeRequest(`${apiUrl}${getEndpoints[name]}`);
        return {
            content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
            isError: false,
        };
    }
  • src/index.ts:173-176 (registration)
    Registers the kobold_max_length tool in the ListTools response with its name, description, and input schema.
        name: "kobold_max_length",
        description: "Get current max length setting",
        inputSchema: zodToJsonSchema(MaxLengthSchema),
    },
  • Defines the input schema for kobold_max_length tool as BaseConfigSchema (apiUrl optional). BaseConfigSchema is defined at lines 11-13.
    const MaxLengthSchema = BaseConfigSchema;
  • Helper function used by the handler to make HTTP requests to the KoboldAI API.
    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?

No annotations are provided, so the description carries the full burden of behavioral disclosure. The description only states what the tool does ('Get current max length setting') without explaining what 'max length' refers to (e.g., token length, context length), whether this is a read-only operation, what the output format might be, or any error conditions. This leaves significant gaps in understanding the tool's behavior.

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, clear sentence with no wasted words. It's front-loaded with the core purpose and efficiently communicates the tool's function without unnecessary elaboration, making it easy to parse quickly.

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 context: no annotations, no output schema, and a simple but undocumented parameter, the description is incomplete. It doesn't explain what 'max length' means in this context (e.g., related to AI model generation), what the return value looks like, or how this tool fits with siblings like 'kobold_max_context_length'. For a tool in a complex AI-related server, this leaves too much unspecified.

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

Parameters4/5

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

The input schema has 1 parameter (apiUrl) with 0% schema description coverage, meaning the schema provides no documentation for this parameter. The description doesn't mention parameters at all, which is acceptable since there's only one optional parameter (0 required) and the tool likely functions without it. However, it doesn't explain what the apiUrl parameter does or when it should be used, leaving a minor gap.

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 'Get current max length setting' clearly states the action (Get) and resource (max length setting), making the purpose understandable. However, it doesn't distinguish this tool from its sibling 'kobold_max_context_length', which appears related but has a different name, leaving some ambiguity about what specifically distinguishes these two tools.

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. With sibling tools like 'kobold_max_context_length' and 'kobold_model_info' that might provide related information, there's no indication of when this specific tool is appropriate or what context it serves compared to others.

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