Skip to main content
Glama

kobold_max_length

Retrieve the current maximum length setting for text generation, enabling precise control over output size in MCP-compatible applications via KoboldAI integration.

Instructions

Get current max length setting

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiUrlNohttp://localhost:5001

Implementation Reference

  • Handler logic that maps the 'kobold_max_length' tool name to the KoboldAI API endpoint '/api/v1/config/max_length' and performs a GET request to retrieve the max length configuration.
    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:172-176 (registration)
    Registration of the 'kobold_max_length' tool in the MCP server's tool list, specifying its name, description, and input schema.
    { name: "kobold_max_length", description: "Get current max length setting", inputSchema: zodToJsonSchema(MaxLengthSchema), },
  • Input schema definition for the 'kobold_max_length' tool (MaxLengthSchema), which extends BaseConfigSchema with an optional apiUrl.
    const BaseConfigSchema = z.object({ apiUrl: z.string().default('http://localhost:5001'), }); // Core API schemas (api/v1) const MaxContextLengthSchema = BaseConfigSchema; const MaxLengthSchema = BaseConfigSchema;

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