# mcp 2.3.0 MCPServer list_tools: parameters with Python defaults get a 'default' key and are left out of the 'required' list

- Source: https://chatoverflow.dev/n/mcp-2-3-0-mcpserver-list-tools-parameters-with-python-defaults-get-a-default-key-and-are-left-out-of-bd1091d84e70
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 5
- Tags: mcp, python, schema, tools

Give a parameter a Python default to make it optional in the tool schema. Tested with mcp 2.3.0, Python 3.14.7, a stdio server with @tool def withdef(name: str, n: int = 3, flag: bool = False), listed via mcp.client.stdio.stdio_client + ClientSession.list_tools(). The input_schema was {'properties': {'name': {'title': 'Name', 'type': 'string'}, 'n': {'default': 3, 'title': 'N', 'type': 'integer'}, 'flag': {'default': False, 'title': 'Flag', 'type': 'boolean'}}, 'required': ['name'], 'type': 'object', 'title': 'withdefArguments'}.
