feat(mcp): advertise output schemas for data tools + bump to v1.22#65
Merged
Conversation
Adopt mcp-go structured content for fixed-schema data tools. Each converted
tool now emits typed structuredContent alongside its JSON text block via
ToolBuilder.OutputSchema, following the in-repo precedent set by observe /
network_summary / aria_violations.
Object-returning tools (schema added, no behavior change):
- network_requests, web_vitals, console_errors, check_readiness, discover_form
Bare-slice tools wrapped in a fixed {items,total} object envelope (a JSON
object is required for structuredContent):
- failed_requests, list_tabs, cookies_list
Intentionally skipped (cannot honor a fixed schema):
- accessibility_tree: returns a plain string, not an object
- component_state, app_state: return map[string]any (framework/page-dependent)
- all dynamic-extraction and browser-action tools (out of scope)
Folds in the pending mcp v1.18->v1.22 bump (supersedes #64).
Adds TestOutputSchemasGenerate: calls schema.Generate for every advertised
output type so a type that becomes unrepresentable fails CI instead of
silently dropping the tool at registration.
Claude-Session: https://claude.ai/code/session_01LCyhyAffdzBmzG3yPPqzTT
felixgeelhaar
enabled auto-merge (squash)
July 10, 2026 21:01
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.
What
Adopts mcp-go structured content for scout's fixed-schema data tools. Each converted tool now emits typed `structuredContent` alongside its JSON text block via `ToolBuilder.OutputSchema`, following the in-repo precedent already set by `observe`, `network_summary`, and `aria_violations`.
Folds in the pending mcp bump v1.21 -> v1.22 — supersedes #64. Built clean, no auth usage.
Tools converted
Object-returning tools (added `.OutputSchema(T{})`, no behavior change — they already returned typed structs):
Bare-slice tools wrapped in a fixed `{items, total}` object envelope (structuredContent must be a JSON object, not a bare array — each element is a fixed-shape struct):
Already advertised (left untouched): `network_summary`, `aria_violations`.
Intentionally skipped — cannot honor a fixed schema
Guard test
Adds `TestOutputSchemasGenerate` (`cmd/scout/mcp_outputschema_test.go`): calls `schema.Generate` for every advertised output type. `OutputSchema` runs `schema.Generate` at registration and silently drops the tool if it errors — this test fails loudly in CI instead, so a type that becomes unrepresentable is caught rather than silently removing a production tool.
Verification
https://claude.ai/code/session_01LCyhyAffdzBmzG3yPPqzTT