Reject unknown MCP bounty list arguments#892
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe PR adds strict argument validation to the ChangesMCP list_bounties argument validation
Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
mauricemohr88-debug
left a comment
There was a problem hiding this comment.
Current-head review for #838 on d8fac662424bb23000d256c8ab2ee2065b2bb5a7.
Evidence checked:
- Inspected the
list_bountiesruntime guard inapp/mcp_tools.py; the new unexpected-argument check runs before defaults are applied, so typoed calls likestatuzfail instead of silently returning the default open-bounty list. - Verified the allowed argument set matches the MCP
list_bountiessurface documented inapp/mcp.py:status,q,sort,limit, andavailability. Repository/issue lookup remains onget_bounty,list_bounty_attempts, andsubmit_work_proof. - Inspected the API/MCP regression tests in
tests/test_api_mcp.pyandtests/test_mcp_tools.py; both cover the typo path. - Ran
uv run --python 3.12 --extra dev python -m pytest tests/test_mcp_tools.py tests/test_api_mcp.py::test_mcp_list_bounties_rejects_invalid_filters -q: 16 passed, 1 existing Starlette warning. - Ran
uv run --python 3.12 --extra dev ruff check app/mcp_tools.py tests/test_api_mcp.py tests/test_mcp_tools.py: passed. - Ran
uv run --python 3.12 --extra dev ruff format --check app/mcp_tools.py tests/test_api_mcp.py tests/test_mcp_tools.py: 3 files already formatted. - Ran
uv run --python 3.12 --extra dev mypy app/mcp_tools.py app/mcp.py: success. - Ran
uv run --python 3.12 --extra dev python scripts/docs_smoke.py: docs smoke ok. - Ran
git diff --check origin/main...HEADandgit merge-tree --write-tree origin/main HEAD: clean.
No blocker found. The change is narrow, test-backed, and improves agent safety by rejecting typoed list_bounties arguments before returning misleading bounty discovery results.
Bounty #844
Summary
list_bountiesMCP arguments before applying defaults;{ statuz: paid }from silently returning the default open-bounty query;list_bountiesargument behavior in MCP examples.Duplicate / Scope Check
get_balancewording or selector guidance;qlength or search validation;submit_work_proofargument handling;list_bounties, not a broadtools/listinputSchema PR, and feat: add MCP input schemas #738 is currently dirty/needs-info;Validation
uv run --python 3.12 --extra dev python -m pytest tests/test_mcp_tools.py tests/test_api_mcp.py::test_mcp_list_bounties_rejects_invalid_filters -q-> 16 passed, 1 existing warning.uv run --python 3.12 --extra dev python -m pytest tests/test_api_mcp.py tests/test_mcp_tools.py -q-> 114 passed, 1 existing warning.uv run --python 3.12 --extra dev ruff check app/mcp_tools.py tests/test_api_mcp.py tests/test_mcp_tools.py-> passed.uv run --python 3.12 --extra dev ruff format --check app/mcp_tools.py tests/test_api_mcp.py tests/test_mcp_tools.py-> 3 files already formatted.uv run --python 3.12 --extra dev mypy app/mcp_tools.py app/mcp.py-> success.uv run --python 3.12 --extra dev python scripts/docs_smoke.py-> docs smoke ok.git diff --check origin/main...HEAD-> clean.git merge-tree --write-tree origin/main HEAD-> clean treeed74afeb10150b5eb6f0814bf1cba01cf0d541b9.Summary by CodeRabbit
Bug Fixes
list_bountiestool now validates input arguments and rejects typos or unexpected parameters, providing clear error messages instead of silently ignoring invalid inputs.Documentation