Skip to content

[BUG][API]: Tool description validation ignores VALIDATION_STRICT env var β€” blocks MCP server registrationΒ #3711

@hanniesnng

Description

@hanniesnng

🐞 Bug Summary

Briefly describe the issue or unexpected behavior.

validation is hardcoded and ignores these env vars

  - name: VALIDATION_STRICT
    value: "false"
  - name: JSON_SCHEMA_VALIDATION_STRICT
    value: "false"
  - name: EXPERIMENTAL_VALIDATE_IO
    value: "false"

Version 0.9.0 works smoothly with unsafe characters in description for MCP gateway
Version 1.0.0.Beta2 stops loading up the MCP server tools. Error received:

All 1 tools failed validation. First error: Validation failed for tool 'search': [{'type': 'value_error', 'loc': ('description',), 'msg': "Value error, Description contains unsafe characters: '> '", 'input': 'Search FICO product documentation 

After trying to mute a lot of validation toggles, I think we still have this issue that the description validation uses a hardcoded
_HTML_SPECIAL_CHARS_RE pattern that can't be disabled via settings.

🧩 Affected Component

Select the area of the project impacted:

  • mcpgateway - API
  • mcpgateway - UI (admin panel)
  • mcpgateway.wrapper - stdio wrapper
  • Federation or Transports
  • CLI, Makefiles, or shell scripts
  • Container setup (Docker/Podman/Compose)
  • Other (explain below)

πŸ” Steps to Reproduce

  1. Spin up an MCP server with description including special characters for especially Markdown (** or <>)
  2. Connect that MCP server to Contextforge
  3. Will get gateway connection error

πŸ€” Expected Behavior

What should have happened instead?
If we set vars to null those validation checks, the MCP server should pass registration in Contextforge (as it did work in 0.9.0)
Should have a generic skip_validation flag if we dont really need strict validation


πŸ““ Logs / Error Output

Paste any relevant stack traces or logs here.
⚠️ Do not paste secrets, credentials, or tokens.


Metadata

Metadata

Assignees

Labels

MUSTP1: Non-negotiable, critical requirements without which the product is non-functional or unsafeapiREST API Related itembugSomething isn't working

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions