Skip to content

Validate manifest schema bounds and common formats#4

Open
RitwijParmar wants to merge 1 commit into
ZeroPathAI:mainfrom
RitwijParmar:codex/zeropath-schema-bounds
Open

Validate manifest schema bounds and common formats#4
RitwijParmar wants to merge 1 commit into
ZeroPathAI:mainfrom
RitwijParmar:codex/zeropath-schema-bounds

Conversation

@RitwijParmar
Copy link
Copy Markdown

Summary

ZeroPath's live MCP manifest already uses JSON Schema constraints such as minLength, maxLength, minimum, maximum, and format across tool inputs. The current lightweight validator handles type/required/properties/composition, but it lets those constraints pass through unchecked.

This PR extends the client-side validator to catch more malformed agent tool calls before they hit the ZeroPath API:

  • string minLength / maxLength
  • numeric minimum / maximum
  • numeric exclusiveMinimum / exclusiveMaximum
  • regex pattern
  • common format values used by API manifests: uuid, uri, and email

Unknown formats remain annotations instead of hard failures so adding a future format does not disable all client-side validation through UnsupportedSchemaError.

Why

For MCP users, these failures are easier to debug when the server rejects them locally with a structured validation issue instead of forwarding a bad UUID, out-of-range pagination value, or malformed URL/email to the API and surfacing a deeper backend error.

Tests

  • /Users/ritwij/Library/Python/3.9/bin/uv run --python 3.13 pytest -q
  • /Users/ritwij/Library/Python/3.9/bin/uv run --python 3.13 python -m compileall src tests
  • git diff --check

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