Skip to content

Sync: New scrape parameter — str, int, bool (from #10916) #127

@RapierCraft

Description

@RapierCraft

Ecosystem Sync

Source: RapierCraftStudios/AlterLab @ staging
PR: #10916
Commits:

06f536e Merge pull request #10916 from RapierCraftStudios/fix/ci-formatting
daa5ccc fix(ci): auto-format schema files for Black compliance

Detected by: ecosystem-sync.yml workflow


What to Update in MCP Server

  1. Tool schema — Add parameter to the Zod schema in src/tools/scrape.ts
  2. Client — Pass parameter through in src/client.ts
  3. Types — Update src/types.ts if new enum values
  4. Format — Update src/format.ts if the response shape changed

Files to modify

  • src/tools/scrape.ts — Zod schema + tool handler
  • src/client.ts — HTTP client pass-through
  • src/types.ts — Type definitions (if needed)

API Changes (Diff)

services/api/app/schemas/scrape.py

diff --git a/services/api/app/schemas/scrape.py b/services/api/app/schemas/scrape.py
index 48b35f1..c1ed919 100644
--- a/services/api/app/schemas/scrape.py
+++ b/services/api/app/schemas/scrape.py
@@ -34,8 +34,7 @@ def validate_url_has_valid_host(url: HttpUrl) -> HttpUrl:
     stripped = host.strip(".")
     if not stripped or len(stripped) < 2:
         raise ValueError(
-            f"URL has no valid hostname: '{host}'. "
-            "Provide a full URL like https://example.com"
+            f"URL has no valid hostname: '{host}'. " "Provide a full URL like https://example.com"
         )
     # Require at least one dot for a real domain (allow localhost for dev
     # and IPv6 addresses which contain colons but no dots).
@@ -154,9 +153,7 @@ class FillAction(BaseModel):
     """Fill an input field with a value."""
 
     type: Literal["fill"] = "fill"
-    selector: str = Field(
-        ..., max_length=500, description="CSS selector of input element"
-    )
+    selector: str = Field(..., max_length=500, description="CSS selector of input element")
     value: str = Field(..., max_length=5000, description="Value to fill into the input")
 
 
@@ -175,9 +172,7 @@ class ScrollAction(BaseModel):
     """Scroll the page in a direction by a number of viewport heights."""
 
     type: Literal["scroll"] = "scroll"
-    direction: Literal["down", "up"] = Field(
-        default="down", description="Scroll direction"
-    )
+    direction: Literal["down", "up"] = Field(default="down
... (truncated)

Source Files Changed

  • services/api/app/schemas/scrape.py

Acceptance Criteria

  • Parameter/endpoint parity with AlterLab API
  • TypeScript types updated
  • Build passes (npm run build)
  • Tested against local AlterLab instance

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium prioritysyncSync with AlterLab API changes

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions