Skip to content

Enforce strict input schemas#32

Merged
esgn merged 1 commit intomasterfrom
31-inputschema-strict
Apr 8, 2026
Merged

Enforce strict input schemas#32
esgn merged 1 commit intomasterfrom
31-inputschema-strict

Conversation

@esgn
Copy link
Copy Markdown
Member

@esgn esgn commented Apr 7, 2026

closes #31

This pull request enforces strict input validation on all tool input schemas by using Zod's .strict() method, ensuring that any unexpected arguments are rejected. Additionally, a new test suite is added to verify that each tool properly rejects inputs containing unexpected fields.

Input Schema Strictness:

  • Added .strict() to all tool input schemas in src/tools, so any unexpected properties in the input will now cause validation to fail. This change affects the following tools: AdminexpressTool, AltitudeTool, AssietteSupTool, CadastreTool, GeocodeTool, GpfWfsDescribeTypeTool, GpfWfsGetFeaturesTool, GpfWfsListTypesTool, GpfWfsSearchTypesTool, and UrbanismeTool.
    Testing:

  • Added a new test file test/tools/strict-input.test.ts that systematically checks each tool to ensure it rejects any input containing unexpected arguments, improving reliability and preventing silent acceptance of invalid data.

@esgn esgn requested a review from mborne April 7, 2026 19:23
Copy link
Copy Markdown
Contributor

@mborne mborne left a comment

Choose a reason for hiding this comment

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

gpfWfsListTypesInputSchema to clarify

Comment thread src/tools/GpfWfsListTypesTool.ts
@esgn esgn merged commit a24662f into master Apr 8, 2026
2 checks passed
@esgn esgn deleted the 31-inputschema-strict branch April 8, 2026 16:28
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.

Strict inputSchema validation

2 participants