Skip to content

fix(store): report non-object inputSchema and surface schema findings - #215

Merged
kerlenton merged 6 commits into
kerlenton:mainfrom
syf2211:fix/schema-non-object-root
Aug 8, 2026
Merged

fix(store): report non-object inputSchema and surface schema findings#215
kerlenton merged 6 commits into
kerlenton:mainfrom
syf2211:fix/schema-non-object-root

Conversation

@syf2211

@syf2211 syf2211 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Detect and report tool inputSchema values that are not valid object schemas (per MCP spec), record non-default JSON Schema dialects as observations, and surface all schema findings through check, export, and an opt-in --fail-on schema signal.

Motivation

Fixes #199 — servers like @modelcontextprotocol/server-filesystem can advertise tools whose inputSchema is only {"":"..."} with no type: object. SDKs reject these silently, but mcpsnoop check previously passed with zero warnings. Schema composition findings (oneOf, etc.) were computed but only shown in the TUI.

Changes

  • Add nonObjectRoot finding for absent/invalid inputSchema roots; warn on the tools/list response frame
  • Add nonDefaultDialect observation for non-2020-12 $schema on inputSchema and outputSchema
  • Merge outputSchema dialect findings into per-tool Findings
  • Print schema findings: section in check text output; add schema to --fail-on
  • Include per-tool findings in JSON/text/HTML export
  • Rank nonObjectRoot first in TUI schema headline order

Tests

go test ./internal/store ./cmd/mcpsnoop ./internal/exporter

All pass. Full suite except two pre-existing TUI style tests on upstream main (TestStreamRowShowsSupersededStatusInWarnStyle, TestStatusStyleWarnsOnTruncated).

Notes

  • nonObjectRoot fails default check via the existing warn signal (warning on frame)
  • Dialect/composition findings require --fail-on schema to fail CI
  • Reviewed with composer-2.5 subagent before submission

syf2211 added 3 commits August 7, 2026 18:07
- Detect nonObjectRoot on inputSchema and warn on tools/list frames
- Record nonDefaultDialect on inputSchema and outputSchema as observation
- Surface all schema findings in check, export, and optional --fail-on schema
- Include findings in per-tool JSON/text/HTML export output

Fixes kerlenton#199
@github-actions github-actions Bot added the fix label Aug 7, 2026
@kerlenton

Copy link
Copy Markdown
Owner

Thank you!

@kerlenton
kerlenton merged commit b6191fc into kerlenton:main Aug 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A tool inputSchema that is not an object schema is never reported, and no schema finding reaches check or export

2 participants