Skip to content

fix: catch tool registration errors#155

Draft
cdcabrera wants to merge 1 commit intopatternfly:mainfrom
cdcabrera:20260409-mcpsdk
Draft

fix: catch tool registration errors#155
cdcabrera wants to merge 1 commit intopatternfly:mainfrom
cdcabrera:20260409-mcpsdk

Conversation

@cdcabrera
Copy link
Copy Markdown
Member

@cdcabrera cdcabrera commented Apr 9, 2026

What is it?

  • fix: catch tool registration errors

Notes

  • build(deps): bump @modelcontextprotocol/sdk from 1.27.1 to 1.28.0 #154 released a potential breaking change as "fix." patch potential fail point
  • this work can go in before or after since it's applying logic
  • pf mcp already attempts to convert the json schema to a zod schema (zod released a feature to do this type of conversion) for "tools as plugins". we do not perform this zod conversion for internal tools, it is expected you use a zod/raw zod (zod-like) object.
    • this is a fallback for one-off scenarios where a non-zod schema manages to get through to registration
    • we now log and skip the tool registration
    • we wrap the registration in a try/catch for a smoother consumer experience
  • mcp sdk 1.28.0 still seems to allow a "zod-like" input schema, this may become stricter in the future and would require us to potentially tighten checks more

Updates issue/story

ongoing

caused by #154

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