Skip to content

fix: reject non-array tools in static manifests - #39

Merged
royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
Gambit-Checkmate:fix/reject-invalid-manifest-tools
Sep 12, 2026
Merged

fix: reject non-array tools in static manifests#39
royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
Gambit-Checkmate:fix/reject-invalid-manifest-tools

Conversation

@Gambit-Checkmate

Copy link
Copy Markdown
Contributor

What & why

A static manifest such as {"tools":"MCP001"} currently reaches the rule engine as a string instead of a tool list. Reject non-array tools values during normalization, with an error naming the manifest, before the audit runs.

Closes #25.

Changes

  • Validate the tools collection before constructing an audit target.
  • Cover strings, objects, numbers, and booleans; preserve the existing empty-list behavior for omitted or null tools and support for a bare tool array.
  • Add an Unreleased changelog entry.

Checklist

  • Focused change with a clear description
  • Ran lint / tests / build (npm run lint, npm test, npm run build; no formatter is configured)
  • Updated CHANGELOG
  • Linked the related issue

Validation on Windows with Node.js 24.15.0: all four new invalid-type cases failed on the unfixed code. With the fix, all 76 tests pass, including the stdio integration suite; typechecking, compilation, and git diff --check also pass.

AI assistance was used to prepare this contribution and run the checks above.

@github-actions

Copy link
Copy Markdown

Welcome, @Gambit-Checkmate, and thanks for your first pull request to MCP-audit.

A quick look at CONTRIBUTING.md covers how things are set up and run here.

I'll review this shortly. Ask anything in the thread if something is unclear.

@royalpinto007
royalpinto007 merged commit ca69b9e into AgentPostmortem:main Sep 12, 2026
10 checks passed
@github-actions

Copy link
Copy Markdown

And it's in. Thanks @Gambit-Checkmate.

MCP-audit gets better every time someone outside the repo digs in like this.

If you find MCP-audit useful, consider dropping a star. It helps more people find it.

Happy to see more from you whenever you have the time.

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.

Static manifest with non-array tools lints garbage instead of failing fast

2 participants