add prompts tab
This commit is contained in:
@@ -6,6 +6,10 @@ import {
|
||||
ReadResourceResult,
|
||||
ListResourcesResultSchema,
|
||||
ReadResourceResultSchema,
|
||||
ListPromptsResult,
|
||||
ListPromptsResultSchema,
|
||||
GetPromptResult,
|
||||
GetPromptResultSchema,
|
||||
} from "mcp-typescript/types.js";
|
||||
|
||||
export class McpClient {
|
||||
@@ -62,6 +66,26 @@ export class McpClient {
|
||||
);
|
||||
}
|
||||
|
||||
// Prompt Operations
|
||||
async listPrompts(): Promise<ListPromptsResult> {
|
||||
return await this.client.request(
|
||||
{
|
||||
method: "prompts/list",
|
||||
},
|
||||
ListPromptsResultSchema,
|
||||
);
|
||||
}
|
||||
|
||||
async getPrompt(name: string): Promise<GetPromptResult> {
|
||||
return await this.client.request(
|
||||
{
|
||||
method: "prompts/get",
|
||||
params: { name },
|
||||
},
|
||||
GetPromptResultSchema,
|
||||
);
|
||||
}
|
||||
|
||||
getServerCapabilities() {
|
||||
return this.client.getServerCapabilities();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user