Empty string parameters are not sent (validation error missing required argument)
Describe the bug Untouched fields are not sent at all, even if they are supposed to be empty.
To Reproduce Steps to reproduce the behavior:
With a function like this:
@mcp.tool()
def list_strings(filter: Annotated[str, Field(description='Filter to apply to the list. Case-insensitive contains or /regex/ syntax')], offset: Annotated[int, Field(description='Offset to start listing from (start at 0)')], count: Annotated[int, Field(description='Number of strings to list (100 is a good default, 0 means remainder)')]) -> Page[String]:
"""List all strings in the database (paginated)"""
return make_jsonrpc_request('list_strings', filter, offset, count)
The filter parameter is not optional, but it has to be set to an empty string for an empty filter. When using the inspector not filling in the field causes the filter to be omitted completely:
If you put x in the string field and then press backspace, everything will be sent correctly:
It looks like other clients also have this behavior, discovered it from a discussion here: https://github.com/mrexodia/ida-pro-mcp/issues/67. In my opinion this is a bug.
Expected behavior Send an empty string if the user does not put one.
Logs If applicable, add logs to help explain your problem.
Additional context Add any other context about the problem here.
@mrexodia I will check with this
This issue was resolved with PR #480 .