fix(server): add success envelope to /v1/extract responses so MCP extract tools validate#323
Merged
Merged
Conversation
The stdio/CLI MCP proxies forward the raw /v1/extract REST body verbatim
as structuredContent, which strict clients validate against each tool's
advertised outputSchema. ExtractStartResponse and ExtractStatusResponse
omitted the success field the crw_extract / crw_check_extract_status /
crw_cancel_extract schemas require (and that every other /v1 response
carries), so every extract call over those transports failed with
"data must have required property 'success'".
Set success on both structs at the single canonical serializer
(start = true, status = status != failed), drop the now-redundant
in-server success-injection helper, and add success to the OpenAPI
ExtractAccepted / ExtractStatus components (3.1 + 3.0, crate + docs
copies kept byte-identical). Regression test validates the raw
GET /v1/extract/{id} body against the advertised schema across all
statuses. /v2/extract is untouched.
ref #318
The docs-guards CI keeps docs/agent-onboarding/SKILL.md and mcp/crw-mcp/skills/SKILL.md byte-identical; update the mirror copy's crw_extract return example to match. ref #318
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The stdio and CLI MCP proxies forward the raw
/v1/extractREST body verbatim asstructuredContent, which strict clients validate against each tool's advertisedoutputSchema.ExtractStartResponseandExtractStatusResponseomitted thesuccessfield that thecrw_extract/crw_check_extract_status/crw_cancel_extractschemas require, so every extract call over those transports failed client-side validation withdata must have required property 'success'.successis already carried by every other/v1response (scrape, search, map, crawl); the async extract lifecycle was the only one missing it. The in-server/mcppath compensated by injecting it manually, which is why only the proxied transports broke.Changes:
ExtractStartResponse.success = true;ExtractStatusResponse.success = (status != failed), set in the one canonicalserialize_extract_status.extract_status_valuesuccess-injection helper in the in-server MCP handler; the start handler serializesExtractStartResponsefor a single source of truth.successto OpenAPIExtractAccepted/ExtractStatus(both 3.1 and 3.0 specs, crate + docs copies kept byte-identical for the drift check).GET /v1/extract/{id}body validates against the advertisedcrw_check_extract_statusschema across all five statuses; the contract test now assertssuccessis present and required on both surfaces instead of stripping it./v2/extract(Firecrawl-compat) is untouched.ref #318