Skip to content

Functions with *args or **kwargs are not supported as tools #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 16, 2025

Conversation

DaveBben
Copy link
Contributor

When using the entity_action tool, the Model trying to supply "params" as another argument. This leads to a 400 error when trying to make a request to home assistant. The agent doesn't understand that params can be a variable list of key words. Something with the schema is confusing it.

Upon further inspection, it seems like FastMCP doesn't support kwargs for tools:

Functions with *args or **kwargs are not supported as tools. This restriction exists because FastMCP needs to generate a complete parameter schema for the MCP protocol, which isn’t possible with variable argument lists.

Updated the entity_action so that it takes a dictionary instead. This solves the issue on tool calling and doesn't produce 400 error.

@voska
Copy link
Owner

voska commented Jun 16, 2025

Thanks @DaveBben. Merging.

Take a look at the dev tag for a more reliable mcp experience :)

@voska voska merged commit 3e84a9f into voska:master Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants