kobold_abort
Stop text generation processes in KoboldAI by aborting ongoing operations through the MCP server integration.
Instructions
Abort the currently ongoing generation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apiUrl | No | http://localhost:5001 |
Implementation Reference
- src/index.ts:346-357 (handler)Handler logic for executing the kobold_abort tool (shared with other POST tools): validates input using AbortSchema, then proxies a POST request to KoboldAI API's /api/extra/abort endpoint.if (postEndpoints[name]) { const { endpoint, schema } = postEndpoints[name]; const parsed = schema.safeParse(args); if (!parsed.success) { throw new Error(`Invalid arguments: ${parsed.error}`); } const result = await makeRequest(`${apiUrl}${endpoint}`, 'POST', requestData); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], isError: false, };
- src/index.ts:69-69 (schema)Input schema for kobold_abort tool, inheriting from BaseConfigSchema which provides optional apiUrl.const AbortSchema = BaseConfigSchema;
- src/index.ts:338-338 (registration)Maps the kobold_abort tool name to its KoboldAI API endpoint and schema for dispatching in the CallTool handler.kobold_abort: { endpoint: '/api/extra/abort', schema: AbortSchema },
- src/index.ts:223-227 (registration)Registers kobold_abort tool in the ListTools response with name, description, and input schema.{ name: "kobold_abort", description: "Abort the currently ongoing generation", inputSchema: zodToJsonSchema(AbortSchema), },
- src/index.ts:146-162 (helper)Utility function to make HTTP requests to the KoboldAI backend, used by the kobold_abort handler.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(); }