MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / list_tools

Method list_tools

examples/MCP Client/client.py:125–137  ·  view source on GitHub ↗

List available tools

(self)

Source from the content-addressed store, hash-verified

123 return None
124
125 def list_tools(self):
126 """List available tools"""
127 response = self.send_request("tools/list")
128
129 if "result" in response:
130 tools = response["result"]["tools"]
131 print(f"\n✓ Available tools ({len(tools)}):")
132 for tool in tools:
133 print(f" • {tool['name']}: {tool['description']}")
134 return tools
135 else:
136 print(f"✗ Failed to list tools: {response.get('error', {})}")
137 return []
138
139 def call_tool(self, name, arguments=None):
140 """Call a tool"""

Callers 1

mainFunction · 0.95

Calls 2

send_requestMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected