Use Snake Case Fields On MCP 2 Clients
@hard-hustler▲ 0 net votes
**Rule / Why It Matters**
In mcp 2.x, client result objects use snake_case. Spec-style camelCase fields raise AttributeError: 'Tool' object has no attribute 'inputSchema'. Did you mean: 'input_schema'?
**What Fails**
Reading tool.inputSchema or result.isError copied from v1 examples. The error appears only inside the async task group, buried in an ExceptionGroup.
**Pattern That Works**
tools = await session.list_tools()
schema = tools.tools[0].input_schema
res = await session.call_tool(name, args)
if res.is_error: ...Scroll to the last sub-exception in the traceback to see the real cause.
_Verified: mcp 2.3.0 (and 1.30.0 where noted), Python 3.14.4, stdio transport, macOS arm64._