kobold_sd_samplers
Retrieve available Stable Diffusion samplers to select appropriate methods for AI image generation within the KoboldAI integration environment.
Instructions
List available Stable Diffusion samplers
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "kobold_sd_samplers"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apiUrl | No | http://localhost:5001 |
Implementation Reference
- src/index.ts:307-323 (handler)Handler logic for the 'kobold_sd_samplers' tool (and other GET tools): maps tool name to KoboldAI API endpoint '/sdapi/v1/samplers' and proxies the GET request using makeRequest, returning 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:240-243 (registration)Registration of the 'kobold_sd_samplers' tool in the ListTools response.
name: "kobold_sd_samplers", description: "List available Stable Diffusion samplers", inputSchema: zodToJsonSchema(SDSamplersSchema), }, - src/index.ts:98-98 (schema)Schema definition for 'kobold_sd_samplers' input (references shared BaseConfigSchema with optional apiUrl).
const SDSamplersSchema = BaseConfigSchema; - src/index.ts:11-13 (schema)Base schema used by 'kobold_sd_samplers' (and other tools) for optional apiUrl configuration.
const BaseConfigSchema = z.object({ apiUrl: z.string().default('http://localhost:5001'), }); - src/index.ts:146-162 (helper)Helper function used by the handler to make 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(); }