kobold_sd_samplers
Explore and retrieve available Stable Diffusion samplers to enhance AI-generated image outputs. Integrates seamlessly with Kobold MCP Server for AI text-to-image workflows.
Instructions
List available Stable Diffusion samplers
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apiUrl | No | http://localhost:5001 |
Implementation Reference
- src/index.ts:318-324 (handler)Executes GET tools like kobold_sd_samplers by proxying the request to the KoboldAI API endpoint and returning the JSON response.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:307-316 (registration)Registers the endpoint mapping for kobold_sd_samplers to '/sdapi/v1/samplers' in the dispatch table for GET requests.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', };
- src/index.ts:239-243 (registration)Registers the kobold_sd_samplers tool in the MCP tools list with description and input schema.{ name: "kobold_sd_samplers", description: "List available Stable Diffusion samplers", inputSchema: zodToJsonSchema(SDSamplersSchema), },
- src/index.ts:98-98 (schema)Defines the input schema for kobold_sd_samplers as an alias to BaseConfigSchema (optional apiUrl).const SDSamplersSchema = BaseConfigSchema;
- src/index.ts:146-162 (helper)Helper function used to perform the HTTP request to the KoboldAI backend.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(); }