Skip to content

Add MCP structured tool output (outputSchema + structuredContent)#238

Merged
JE-Chen merged 1 commit into
devfrom
feat/mcp-structured-output
Jun 19, 2026
Merged

Add MCP structured tool output (outputSchema + structuredContent)#238
JE-Chen merged 1 commit into
devfrom
feat/mcp-structured-output

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 19, 2026

Copy link
Copy Markdown
Member

Medium-integration batch — MCP 2025-06-18 structured tool output (framework enhancement; no new AC_* command).

Change

  • MCPTool gains an optional output_schema; to_descriptor() advertises it as outputSchema in tools/list.
  • The server includes structuredContent (the dict result) in a tools/call response when the tool declares an output_schema and the handler returns a dict; non-dict results and schema-less tools are unchanged.
  • ac_validate_rows is the first built-in to adopt it ({ok,total,valid_count,invalid_count,valid,invalid,errors}).

Verification

  • test/unit_test/headless/test_mcp_structured_output.py — 4 tests (descriptor outputSchema, structuredContent only with schema, non-dict excluded, default-registry adoption). ruff/radon/bandit clean.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 10 complexity · 0 duplication

Metric Results
Complexity 10
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit 5cda481 into dev Jun 19, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/mcp-structured-output branch June 19, 2026 14:14
@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant