gitea_api_call tool body parameter validation fails with JSON objects #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug Description
The
gitea_api_calltool fails when passing a JSON body parameter. The tool expects thebodyparameter to be a string, but when an MCP client passes a JSON-like string, it gets parsed as a Python dict before reaching the tool, causing a validation error.Error Message
Steps to Reproduce
gitea_api_call{"name": "test-repo", "private": false}Expected Behavior
The tool should accept the body as a JSON string and parse it internally, as shown in the tool definition:
Actual Behavior
The MCP framework (or FastMCP) appears to be parsing the JSON string into a dict before the tool receives it, causing the type validation to fail.
Workaround
Use
curlor other HTTP clients directly to call the Gitea API.Environment
Possible Fix
The tool signature may need to accept
Union[str, dict]for the body parameter, or the FastMCP/MCP client integration needs to preserve string types for parameters that look like JSON.Bug fix verified! The gitea_api_call tool now correctly handles both string and dict parameters for body and params. Testing complete.
Additional test: String parameter format also works correctly!