Skip to main content
Glama

kobold_detokenize

Convert token IDs to readable text for processing AI-generated content in KoboldAI integrations.

Instructions

Convert token IDs to text

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiUrlNohttp://localhost:5001
tokensYes

Implementation Reference

  • Handler logic for POST-based tools like kobold_detokenize: validates input with schema, proxies POST request to KoboldAI API endpoint, returns JSON response.
    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, };
  • Zod schema defining input for kobold_detokenize: optional apiUrl and array of token numbers.
    const DetokenizeSchema = BaseConfigSchema.extend({ tokens: z.array(z.number()), });
  • src/index.ts:203-207 (registration)
    MCP tool registration in listTools response, providing name, description, and input schema.
    { name: "kobold_detokenize", description: "Convert token IDs to text", inputSchema: zodToJsonSchema(DetokenizeSchema), },
  • src/index.ts:334-334 (registration)
    Internal dispatch registration mapping tool name to KoboldAI endpoint and schema for proxying.
    kobold_detokenize: { endpoint: '/api/extra/detokenize', schema: DetokenizeSchema },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PhialsBasement/KoboldCPP-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server