Improve MCP workflow for policy analysis #13
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixed multiple workflow issues that prevented completing a full policy analysis through the MCP interface. Now Claude can successfully analyze reforms like "lowering UK basic income tax rate to 16p" using only the MCP tools.
Problems Identified
Changes Made
1. Parameter Search (
parameters.py)searchquery parameter to filter by name, label, or description/parameters?search=basic_ratefinds UK income tax parameters instantly2. Policy Creation with Values (
policies.py,policy.py)PolicyCreateschema to includeparameter_valueslist/policiesPOST endpoint to create parameter values atomically with policy3. Workflow Documentation
policies.pymodule docstringanalysis.pywith clear workflow stepsdatasets.pyfor finding UK/US datasets4. Complete Example Flow
Now Claude can execute this workflow:
Testing
Manually traced through the workflow to verify all steps are now discoverable and executable through the MCP interface. The guidance in docstrings is exposed via FastAPI's OpenAPI schema, which FastApiMCP converts to tool descriptions.
Impact
With these changes, Claude can now:
Fixes #11
🤖 Generated with Claude Code