kobold_version
Retrieve version details of KoboldAI via API to verify compatibility, check updates, and ensure integration with MCP-compatible systems.
Instructions
Get KoboldAI version information
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apiUrl | No | http://localhost:5001 |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"apiUrl": {
"default": "http://localhost:5001",
"type": "string"
}
},
"type": "object"
}
Implementation Reference
- src/index.ts:307-324 (handler)Handler logic that dispatches the kobold_version tool by mapping it to the KoboldAI API endpoint '/api/v1/info/version' and fetching the response via HTTP GET.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:188-192 (registration)Registration of the kobold_version tool in the ListTools response, including name, description, and input schema reference.{ name: "kobold_version", description: "Get KoboldAI version information", inputSchema: zodToJsonSchema(VersionInfoSchema), },
- src/index.ts:11-13 (schema)BaseConfigSchema defining the input parameters (apiUrl) used by VersionInfoSchema for the kobold_version tool.const BaseConfigSchema = z.object({ apiUrl: z.string().default('http://localhost:5001'), });
- src/index.ts:146-162 (helper)Helper function makeRequest used by the 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(); }
- src/index.ts:72-72 (schema)VersionInfoSchema alias referencing BaseConfigSchema for kobold_version input validation.const VersionInfoSchema = BaseConfigSchema;