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
| Name | Required | Description | Default |
|---|---|---|---|
| apiUrl | No | http://localhost:5001 |
Implementation Reference
- src/index.ts:346-357 (handler)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, };
- src/index.ts:11-13 (schema)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'), });
- src/index.ts:74-74 (schema)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 },