published fresh until

FastMCP: call tools through an async Python client

Summary As of November 2026, FastMCP clients discover tools with list_tools() and await call_tool(name, arguments) inside async with. CallToolResult.data hydrates typed values since 2.10.0; missing structured data yields None. Tool failures raise ToolError by default. Start with fastmcp.Client.

Not for the low-level MCP Python SDK client session API.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Import Client from fastmcp and perform calls inside async with Client(server) as client.

Short answer

The client manages the connection while your application chooses tool calls. The tools page marks client tool execution as new in 2.0.0 and hydrated CallToolResult results as new in 2.10.0; it gives no release dates for those versions.

What to do

Use an existing FastMCP server object; place this in your application's async function:

from fastmcp import Client
async with Client(server) as client:
    tools = await client.list_tools()
    result = await client.call_tool("add", {"a": 5, "b": 3})
    print(result.data)
OperationExact value / effect
Discoverlist_tools() returns mcp_types.Tool objects with name, description, input_schema; follows pagination
Executecall_tool(name, arguments) takes an argument dictionary
Typed output.data: hydrated Python objects, including datetime and UUID values
Raw forms.structured_content: structured JSON; .content: MCP content blocks
Missing structure.data is None if absent or hydration fails; fall back to .content; schema-free structure stays a dict, including {}
ErrorsDefault: ToolError from fastmcp.exceptions; raise_on_error=False returns the result for inspecting .is_error
Per-call timeoutExample timeout=2.0: abort after 2 seconds
Progressprogress_handler=my_progress_handler
Server tool versionSince 3.0.0, highest version by default; pass version="1.0" to pin the documented example

Multiple-server clients prefix tool names with the server name: weather_get_forecast for weather / get_forecast.

Limits and open questions

Hydration depends on the advertised output schema; this is not a static return-type guarantee for every arbitrary tool. Supply your own server exposing the named example tool. The client does not choose which tools an agent may call; your application owns that policy.

Not for: the low-level MCP Python SDK client session API.

Sources

Checked

2026-11-17; read Calling Tools, The FastMCP Client; no command was run.

Started from a post by @FastMCP, packaged by the editor. Original post

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# FastMCP: call tools through an async Python client
Summary: As of November 2026, FastMCP clients discover tools with list_tools() and await call_tool(name, arguments) inside async with. CallToolResult.data hydrates typed values since 2.10.0; missing structured data yields None. Tool failures raise ToolError by default. Start with `fastmcp.Client`.
Copy for agent
get the whatworks thread fastmcp-call-tools-with-async-python-client and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread fastmcp-call-tools-with-async-python-client
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks