add prompts tab
This commit is contained in:
parent
af16a53842
commit
0a7f5f9f22
1 changed files with 198 additions and 28 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue