Skip to content

Fix review findings and add regression tests - #1

Merged
Endogen merged 1 commit into
mainfrom
review/fix-bugs-1-10
Sep 21, 2026
Merged

Endogen merged 1 commit into
mainfrom
review/fix-bugs-1-10

Conversation

@Endogen

@Endogen Endogen commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes identified during a code review of web2api + web2api-recipes, plus regression tests.

Bugs fixed

  • MCP tool resolution no longer breaks for slugs/endpoints containing _ (matches via build_tool_name instead of string-splitting).
  • Filtered MCP call routes now enforce only/exclude (previously ignored).
  • Param pagination supports an optional next-page selector for accurate has_next.
  • Non-scalar scraped fields are JSON-serialized instead of failing response validation.
  • Response cache is cleared on recipe install/update/uninstall.
  • Catalog trust gets an explicit safe default via catalog_entry_is_trusted (shared by CLI + API).
  • _build_error_response guards against unknown endpoints.
  • MCP tool errors return proper HTTP status codes (status_code_for_error moved to schemas.py).
  • MCP page parameter is now honored in both the HTTP bridge and protocol tools.
  • InvalidParamsError maps to INVALID_PARAMS; scrapers use coerce_int/coerce_float.
  • Removed dead fetch_remote_tree_hash, switched upload route to File(default=None).

Tests

  • Added test_scraper.py, test_schemas.py, test_mcp_bridge.py, test_mcp_bridge_routes.py; extended test_mcp_server.py.
  • Full suite: 144 passed, 0 skipped (incl. live Hacker News test with Chromium).

Companion recipes changes: Endogen/web2api-recipes#1

- Fix MCP tool resolution for slugs/endpoints containing underscores
- Enforce only/exclude filters on filtered MCP call routes
- Support optional next-page selector for param-based pagination
- Coerce non-scalar scraped fields to JSON strings
- Invalidate response cache on recipe install/update/uninstall
- Add explicit catalog trust default (untrusted) via catalog_entry_is_trusted
- Guard _build_error_response against unknown endpoints
- Move status_code_for_error to schemas and reuse it in the MCP bridge
- Honor the page parameter in MCP bridge and protocol tools
- Map MCP tool errors to proper HTTP status codes
- Add InvalidParamsError + coerce_int/coerce_float scraper helpers
- Map InvalidParamsError to INVALID_PARAMS in the scraping engine
- Remove dead fetch_remote_tree_hash helper
- Use File(default=None) for the upload route

Add tests for coercion helpers, status mapping, MCP tool resolution,
and MCP bridge routes (page passthrough, filtered enforcement, error status).
@Endogen
Endogen force-pushed the review/fix-bugs-1-10 branch from 6888490 to 2bd018a Compare September 21, 2026 22:52
@Endogen
Endogen merged commit 0e36ba4 into main Sep 21, 2026
4 checks passed
@Endogen
Endogen deleted the review/fix-bugs-1-10 branch September 21, 2026 22:53
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.

1 participant