kobold_model_info
Retrieve current model details using the Kobold MCP Server, enabling seamless integration with KoboldAI and MCP-compatible applications for text generation tasks.
Instructions
Get current model information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apiUrl | No | http://localhost:5001 |
Implementation Reference
- src/index.ts:307-324 (handler)Handler logic for kobold_model_info: maps the tool name to '/api/v1/model' endpoint and performs HTTP GET request to KoboldAI API, returning the model info as JSON.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:11-13 (schema)BaseConfigSchema defining optional apiUrl, used by ModelInfoSchema for tool input validation.const BaseConfigSchema = z.object({ apiUrl: z.string().default('http://localhost:5001'), });
- src/index.ts:71-71 (schema)ModelInfoSchema alias to BaseConfigSchema, used in tool inputSchema.const ModelInfoSchema = BaseConfigSchema;
- src/index.ts:183-187 (registration)Registers the kobold_model_info tool in the ListTools response.{ name: "kobold_model_info", description: "Get current model information", inputSchema: zodToJsonSchema(ModelInfoSchema), },
- src/index.ts:146-162 (helper)makeRequest helper function used by the tool handler to perform 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(); }