Repository navigation
Conversation
4 tasks
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
Part of #744: the storage and small-payload parts of the plan (its PR 1 without the binary paths). The MCP spec recommends that a tool returning
structuredContentalso return it serialized in a text block for backwards compatibility. These tools didn't do that: theircontent[0]was prose or partial JSON.Remaining #744 work, as follow-up PRs:
get-key-value-store-recordpaths, after fix: Stop get-key-value-store-record from reading whole records #1870 lands. It rewrites those paths, and fix: Return a normal result for a missing key-value store record #1778 / feat: Accept runId in storage retrieval tools #1782 edit the same file.What changed
Before:
content[0]was the JSON of the data withoutsummary/nextStep.send-server-actor-request: the same, also withouterrorMessage.search-actors(-widget),search-apify-docs,fetch-actor-mcp-tool-list,report-problem:content[0]was prose.Now:
content[0]isJSON.stringifyof exactly the returnedstructuredContent, and the existing narrative, links and caveats follow as separate blocks. Storage goes throughbuildStorageResponse; the other tools are edited at their call sites. A shared rule inrespondOkwould have duplicated the JSON for the ~25 callers that already mirror, and would have changed the large-payload tools ahead of their measurement.The text content of 13 tools changes, so internal's contract tests may need updating if they assert on
content[0].Notes for reviewers (human-written)
Proof it works
Each changed response has a test asserting that
JSON.parse(content[0].text)deep-equalsstructuredContent. That's 12 new cases:buildStorageResponse()with and withoutnextStep, plus every return site of the other 6 tools, including results and no-results paths. All failed on master and pass now. Tests that read the narrative fromcontent[0]now read it fromcontent[1].co-written with Claude Code.