Clean up docs

This commit is contained in:
Jeremiah Lowin 2025-07-03 11:24:53 -04:00
commit 5ddb54bbd4
4 changed files with 5 additions and 5 deletions

View file

@ -176,7 +176,7 @@ async with client:
# Execute a tool
result = await client.call_tool("multiply", {"a": 5, "b": 3})
print(result[0].text) # "15"
print(result.data) # 15
```
See [Tools](/clients/tools) for detailed documentation.

View file

@ -22,7 +22,7 @@ from fastmcp import FastMCP, Client
def mcp_server():
server = FastMCP("TestServer")
@server.tool
@server.tool
def greet(name: str) -> str:
return f"Hello, {name}!"
@ -32,7 +32,7 @@ async def test_tool_functionality(mcp_server):
# Pass the server directly to the Client constructor
async with Client(mcp_server) as client:
result = await client.call_tool("greet", {"name": "World"})
assert result[0].text == "Hello, World!"
assert result.data == "Hello, World!"
```
This pattern creates a direct connection between the client and server, allowing you to test your server's functionality efficiently.

View file

@ -180,7 +180,7 @@ async def test_dynamic_mount():
async with Client(main_mcp) as client:
result = await client.call_tool("dynamic_added_later")
print("Result:", result[0].text)
print("Result:", result.data)
# Shows: "Tool Added Dynamically!"
if __name__ == "__main__":

View file

@ -114,7 +114,7 @@ async def main():
# Call one of the generated tools
print("\n\nCalling tool 'get_user_by_id'...")
user = await client.call_tool("get_user_by_id", {"id": 1})
print(f"Result:\n{user[0].text}")
print(f"Result:\n{user.data}")
if __name__ == "__main__":
asyncio.run(main())