docs: Update README for client method usage

This commit is contained in:
SToneX 2025-03-11 15:34:30 +08:00
commit 6bfa975eb2

View file

@ -459,15 +459,20 @@ await client.connect(transport);
const prompts = await client.listPrompts();
// Get a prompt
const prompt = await client.getPrompt("example-prompt", {
arg1: "value"
const prompt = await client.getPrompt({
name: "example-prompt",
arguments: {
arg1: "value"
}
});
// List resources
const resources = await client.listResources();
// Read a resource
const resource = await client.readResource("file:///example.txt");
const resource = await client.readResource({
uri: "file:///example.txt"
});
// Call a tool
const result = await client.callTool({