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 },
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the basic function without any information about side effects (e.g., whether it modifies state), performance characteristics (e.g., speed, limitations), error handling, or output format. For a tool with no annotation coverage, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core purpose, making it easy to parse quickly. Every word earns its place by conveying essential information without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (a conversion tool with 2 parameters), no annotations, no output schema, and 0% schema coverage, the description is incomplete. It lacks details on behavior, parameters, output format, and usage context. While concise, it doesn't provide enough information for an agent to use the tool effectively without additional guesswork.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, meaning the schema provides no descriptions for the two parameters. The description adds no parameter semantics beyond the schema—it doesn't explain what 'tokens' represents (e.g., token IDs from a specific model), what format 'apiUrl' expects, or any constraints. With low coverage, the description fails to compensate, leaving parameters poorly documented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Convert token IDs to text' clearly states the verb ('Convert') and resource ('token IDs to text'), making the purpose immediately understandable. It distinguishes from siblings like 'kobold_token_count' (which counts tokens) or 'kobold_complete' (which generates text), though it doesn't explicitly mention these distinctions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing token IDs from another process), context (e.g., post-processing after tokenization), or exclusions (e.g., not for generating new text). With many sibling tools for text generation and processing, this lack of guidance is a significant gap.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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