kobold_perf_info
Retrieve performance metrics from the Kobold MCP Server to monitor and optimize integration with KoboldAI and MCP-compatible applications.
Instructions
Get performance information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apiUrl | No | http://localhost:5001 |
Implementation Reference
- src/index.ts:193-197 (registration)Registration of the 'kobold_perf_info' tool in the ListTools response, including name, description, and inputSchema based on PerfInfoSchema.{ name: "kobold_perf_info", description: "Get performance information", inputSchema: zodToJsonSchema(PerfInfoSchema), },
- src/index.ts:70-70 (schema)Definition of PerfInfoSchema, which is used for input validation of the kobold_perf_info tool (aliases BaseConfigSchema).const PerfInfoSchema = BaseConfigSchema;
- src/index.ts:11-13 (schema)BaseConfigSchema defining the common 'apiUrl' parameter used by PerfInfoSchema.const BaseConfigSchema = z.object({ apiUrl: z.string().default('http://localhost:5001'), });
- src/index.ts:307-323 (handler)Handler logic within CallToolRequestSchema that dispatches GET requests for kobold_perf_info to the KoboldAI API endpoint '/api/extra/perf' using makeRequest and returns the JSON response.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:146-162 (helper)Helper function makeRequest used by the tool handler to perform HTTP requests to the KoboldAI backend 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(); }