Skip to main content
Glama

kobold_last_logprobs

Retrieve token log probabilities from the most recent request using this tool, enabling detailed analysis of text generation outputs in Kobold MCP Server.

Instructions

Get token logprobs from the last request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiUrlNohttp://localhost:5001

Implementation Reference

  • Handler logic that executes the kobold_last_logprobs tool: validates input arguments using the schema, proxies the request via POST to the KoboldAI API endpoint '/api/extra/last_logprobs', and returns the JSON response as text content.
    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, };
  • BaseConfigSchema: defines the input parameters (apiUrl with default) used by LastLogProbsSchema for the kobold_last_logprobs tool.
    const BaseConfigSchema = z.object({ apiUrl: z.string().default('http://localhost:5001'), });
  • LastLogProbsSchema: aliases BaseConfigSchema for input schema validation of the kobold_last_logprobs tool.
    const LastLogProbsSchema = BaseConfigSchema;
  • src/index.ts:228-232 (registration)
    Registration of the kobold_last_logprobs tool in the ListTools response, specifying name, description, and input schema.
    { name: "kobold_last_logprobs", description: "Get token logprobs from the last request", inputSchema: zodToJsonSchema(LastLogProbsSchema), },
  • src/index.ts:339-339 (registration)
    Internal dispatch registration mapping 'kobold_last_logprobs' to its KoboldAI API endpoint '/api/extra/last_logprobs' and schema.
    kobold_last_logprobs: { endpoint: '/api/extra/last_logprobs', schema: LastLogProbsSchema },

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