Repository navigation
fix(mcp): preserve resource link descriptors in tool output - #4420
Open
CryoThrust wants to merge 1 commit into
Open
CryoThrust wants to merge 1 commit into
CryoThrust wants to merge 1 commit into
Conversation
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
This branch has not been deployed
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.
AgentScope-Java Version
2.1.0-SNAPSHOT (
main@5a315a9af)Description
Fixes #4419.
A successful MCP tool response containing
resource_linkcurrently turns into[Unsupported content type: ResourceLink], discarding the resource URI. The pinned SDK already supports this content type.Convert resource links into JSON text descriptors at their original content position. Preserve
type,name,uriand availabletitle,description,mimeType,size; do not fetch resources or expose server_metaor client annotations in model input. Existing text/media/embedded-resource conversion and opt-in result metadata remain unchanged. No SDK upgrade or public API change is needed.Regressions cover full descriptors with Unicode/escaping, minimal non-HTTP references, mixed text/structured-content ordering, and the public
McpTool.callAsyncpath with a metadata customizer. Both link metadata and result metadata stay out of the model-visible descriptor. EN/ZH guides explain that resource reading is a separate operation.Verification
Two URI-preservation regressions fail on the unchanged base with no skips. The converter, tool and result-metadata suites pass 104 cases after the fix, with no failures/errors/skips.
On Java 17:
The full 114-module clean verification passed in 8:28: 13,493 tests, zero failures/errors, 221 skipped. Skipped provider/platform tests are not claimed as executed. Tests use SDK objects and mocked wrappers; no live MCP server or resource fetch is claimed.
Documentation checks passed from
docs/:npm test,npm run validate,npm run broken-links.Checklist