Skip to content

feat(tool): expose MCP output schemas in tool definitions#1221

Merged
LearningGp merged 2 commits into
agentscope-ai:mainfrom
Alexxigang:feat/mcp-output-schema
Apr 29, 2026
Merged

feat(tool): expose MCP output schemas in tool definitions#1221
LearningGp merged 2 commits into
agentscope-ai:mainfrom
Alexxigang:feat/mcp-output-schema

Conversation

@Alexxigang

Copy link
Copy Markdown
Contributor

Summary

  • expose MCP outputSchema through AgentTool, McpTool, and ToolSchema
  • preserve output schemas when registering MCP tools via McpClientManager
  • add regression coverage for schema propagation and toolkit exposure

Why this fix

McpSchema.Tool already provides outputSchema(), but the current registration flow drops it before the tool reaches AgentScope's tool schema layer. This prevents downstream consumers from seeing structured output contracts for MCP-backed tools.

Validation

  • mvn -pl agentscope-core -Dtest=McpClientManagerTest,ExternalToolSupportTest,ToolSchemaProviderTest,McpToolTest,ToolkitTest test -q
  • mvn -pl agentscope-core spotless:check -q

@codecov

codecov Bot commented Apr 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Comment thread agentscope-core/src/main/java/io/agentscope/core/tool/McpClientManager.java Outdated
@Alexxigang

Copy link
Copy Markdown
Contributor Author

Addressed the review point in McpClientManager: preset params are now kept as a single source of truth through RegisteredToolFunction -> ToolExecutor, while MCP tool registration still uses them only for schema filtering and callback propagation.

Re-ran targeted validation:

  • mvn -pl agentscope-core '-Dtest=McpClientManagerTest,ToolkitTest,ToolSchemaProviderTest,McpToolTest' test

@LearningGp LearningGp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LearningGp LearningGp merged commit 4f213af into agentscope-ai:main Apr 29, 2026
5 checks passed
liangxingguang pushed a commit to liangxingguang/agentscope-java that referenced this pull request May 21, 2026
…-ai#1221)

## Summary
- expose MCP `outputSchema` through `AgentTool`, `McpTool`, and
`ToolSchema`
- preserve output schemas when registering MCP tools via
`McpClientManager`
- add regression coverage for schema propagation and toolkit exposure

## Why this fix
`McpSchema.Tool` already provides `outputSchema()`, but the current
registration flow drops it before the tool reaches AgentScope's tool
schema layer. This prevents downstream consumers from seeing structured
output contracts for MCP-backed tools.

## Validation
- `mvn -pl agentscope-core
-Dtest=McpClientManagerTest,ExternalToolSupportTest,ToolSchemaProviderTest,McpToolTest,ToolkitTest
test -q`
- `mvn -pl agentscope-core spotless:check -q`
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.

2 participants