@@ -47,7 +47,7 @@ console.log(servers);
4747// Example: ['time', 'fetch', 'git']
4848
4949// List tool definitions for a specific server
50- const tools = await client .servers .time .listTools ();
50+ const tools = await client .servers .time .getTools ();
5151console .log (tools);
5252
5353// Dynamically call a tool via the .tools namespace
@@ -79,7 +79,7 @@ const client = new McpdClient({
7979const servers: string [] = await client .listServers ();
8080
8181// Get tools with proper typing
82- const tools: Tool [] = await client .servers .time .listTools ();
82+ const tools: Tool [] = await client .servers .time .getTools ();
8383
8484// Dynamic tool invocation with error handling via .tools namespace
8585try {
@@ -122,7 +122,7 @@ const servers = await client.listServers();
122122// Returns: ['time', 'fetch', 'git']
123123```
124124
125- #### ` client.getToolSchemas (options?) `
125+ #### ` client.getTools (options?) `
126126
127127Returns tool schemas from all (or specific) servers with names transformed to ` serverName__toolName ` format.
128128
@@ -136,24 +136,24 @@ This is useful for:
136136
137137``` typescript
138138// Get all tools from all servers
139- const allTools = await client .getToolSchemas ();
139+ const allTools = await client .getTools ();
140140// Returns: [
141141// { name: "time__get_current_time", description: "...", inputSchema: {...} },
142142// { name: "fetch__fetch_url", description: "...", inputSchema: {...} },
143143// { name: "git__commit", description: "...", inputSchema: {...} }
144144// ]
145145
146146// Get tools from specific servers only
147- const someTools = await client .getToolSchemas ({ servers: [" time" , " fetch" ] });
147+ const someTools = await client .getTools ({ servers: [" time" , " fetch" ] });
148148```
149149
150- #### ` client.servers.<server>.listTools () `
150+ #### ` client.servers.<server>.getTools () `
151151
152152Returns tool schemas for a specific server.
153153
154154``` typescript
155155// Get tools for a specific server
156- const timeTools = await client .servers .time .listTools ();
156+ const timeTools = await client .servers .time .getTools ();
157157// Returns: [{ name: 'get_current_time', description: '...', inputSchema: {...} }]
158158```
159159
@@ -172,21 +172,21 @@ const result = await client.servers.weather.tools.get_forecast({
172172const time = await client .servers .time .tools .get_current_time ();
173173```
174174
175- #### ` client.servers.<server>.listTools () `
175+ #### ` client.servers.<server>.getTools () `
176176
177- List all tools available on a specific server.
177+ Get all tools available on a specific server.
178178
179179``` typescript
180180// List tools for a server using property access
181- const tools = await client .servers .time .listTools ();
181+ const tools = await client .servers .time .getTools ();
182182for (const tool of tools ) {
183183 console .log (` ${tool .name }: ${tool .description } ` );
184184}
185185
186186// Useful in loops with dynamic server names
187187const servers = await client .listServers ();
188188for (const serverName of servers ) {
189- const tools = await client .servers [serverName ].listTools ();
189+ const tools = await client .servers [serverName ].getTools ();
190190 console .log (` ${serverName }: ${tools .length } tools ` );
191191}
192192```
0 commit comments