make prompts pass args
This commit is contained in:
@@ -80,16 +80,18 @@ export class McpClient {
|
||||
);
|
||||
}
|
||||
|
||||
async getPrompt(name: string): Promise<GetPromptResult> {
|
||||
async getPrompt(
|
||||
name: string,
|
||||
args?: Record<string, string>,
|
||||
): Promise<GetPromptResult> {
|
||||
return await this.client.request(
|
||||
{
|
||||
method: "prompts/get",
|
||||
params: { name },
|
||||
params: { name, arguments: args },
|
||||
},
|
||||
GetPromptResultSchema,
|
||||
);
|
||||
}
|
||||
|
||||
// Tool Operations
|
||||
async listTools(): Promise<ListToolsResult> {
|
||||
return await this.client.request(
|
||||
|
||||
@@ -35,7 +35,7 @@ wss.on("connection", (ws: WebSocket) => {
|
||||
const prompts = await mcpClient.listPrompts();
|
||||
ws.send(JSON.stringify({ type: "prompts", data: prompts }));
|
||||
} else if (command.type === "getPrompt" && command.name) {
|
||||
const prompt = await mcpClient.getPrompt(command.name);
|
||||
const prompt = await mcpClient.getPrompt(command.name, command.args);
|
||||
ws.send(JSON.stringify({ type: "prompt", data: prompt }));
|
||||
} else if (command.type === "listTools") {
|
||||
const tools = await mcpClient.listTools();
|
||||
|
||||
Reference in New Issue
Block a user