server-sdk-py: a wrong-typed tool argument reaches the caller as raw pydantic text, outside the error contract
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- backend-api-design
Research direction
Start in error_contract.py and read how ErrorContractMiddleware wraps call_next, then check FastMCP 4.0 and the newest release for which exception its argument validation raises and whether that surfaces inside the middleware. Run the existing error-contract tests on both protocol eras to see the current shape of a flagged result. The first deliverable is a decision on the three options; only under option 2 do you map the failure to bad_input with a host-safe message, add tests on both eras, and write the paragraph in server-sdk/errors.
Written by the indexing model from the issue text.
Description
Problem
When a tool is called with an argument of the wrong type (for example limit="abc" for an int), FastMCP rejects the call during its own signature validation, before the tool body or any middleware-wrapped handler runs. The caller receives a flagged result whose text is pydantic's validation message, including input_value=..., and no structuredContent.
So on a server that uses add_error_contract, this one failure kind:
- carries no
code, so a host cannot classify it asbad_input; - echoes the caller's input and pydantic's internal wording, which the contract otherwise keeps out of messages;
- is not counted in
service_errors_total.
Every server built on the SDK has this path; it is not specific to one server.
Question to settle first
Should the SDK own this? Options:
- Leave it to FastMCP. It is FastMCP's validation and its message; the result is flagged as an error, which is the part a host relies on most.
- Have
ErrorContractMiddlewarerecognise FastMCP's argument-validation failure and returnbad_inputwith a host-safe message that names the argument and the expected type, without the input value. - Raise it upstream as a FastMCP request for a structured validation error.
Option 2 depends on how FastMCP surfaces the failure to a middleware (which exception type, and whether it is raised inside call_next), which needs checking against FastMCP 4.0 and the newest release before choosing.
Scope if option 2
error_contract.py, tests on both protocol eras, and a paragraph in the docs page server-sdk/errors.
- Dominant language
- TypeScript
- Stars
- 23
- Forks
- 15
- Avg merge
- 4h 28m
- Merged PRs (30d)
- 209
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NimbleBrainInc/nimblebrain
-
area/cli good first issue needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
NimbleBrainInc/nimblebrain#2063 ·
Maintainers usually reply within 1 day
-
area/cli good first issue needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
NimbleBrainInc/nimblebrain#2062 ·
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
NimbleBrainInc/nimblebrain#2011 ·
Maintainers usually reply within 1 day
-
Connector-skill identity derives the org, not the server, from io.github.<org>/<server> namesMay be free again @Coding-Professional claimed this 9 days ago, and no pull request is open. Openneeds-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NimbleBrainInc/nimblebrain#1800 · 1 comment ·
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NimbleBrainInc/nimblebrain#1680 ·
Maintainers usually reply within 1 day
All issues in NimbleBrainInc/nimblebrain
Similar issues
-
bug documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Potential Bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Comfy-Org/ComfyUI_frontend#23773 ·
Maintainers usually reply within 1 day
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
lingdojo/kana-dojo#34301 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
github/gh-aw-firewall#11797 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
code-yeongyu/senpi#7007 ·
Maintainers usually reply within 1 day