[WIP] Refactor everything server to be more modular and use recommended APIs.

* In sampling-request.ts
  - renamed SampleLLMSchema to SamplingRequestSchema
This commit is contained in:
cliffhall 2025-12-09 09:12:42 -05:00
commit 08b6a501ce

View file

@ -7,7 +7,7 @@ import {
import { z } from "zod"; import { z } from "zod";
// Tool input schema // Tool input schema
const SampleLLMSchema = z.object({ const SamplingRequestSchema = z.object({
prompt: z.string().describe("The prompt to send to the LLM"), prompt: z.string().describe("The prompt to send to the LLM"),
maxTokens: z maxTokens: z
.number() .number()
@ -20,7 +20,7 @@ const name = "sampling-request";
const config = { const config = {
title: "Sampling Request Tool", title: "Sampling Request Tool",
description: "Sends the Client a Request for LLM Sampling", description: "Sends the Client a Request for LLM Sampling",
inputSchema: SampleLLMSchema, inputSchema: SamplingRequestSchema,
}; };
/** /**
@ -44,7 +44,7 @@ export const registerSamplingRequestTool = (server: McpServer) => {
name, name,
config, config,
async (args, extra): Promise<CallToolResult> => { async (args, extra): Promise<CallToolResult> => {
const validatedArgs = SampleLLMSchema.parse(args); const validatedArgs = SamplingRequestSchema.parse(args);
const { prompt, maxTokens } = validatedArgs; const { prompt, maxTokens } = validatedArgs;
// Create the sampling request // Create the sampling request