Skip to content

fix(mcp): preserve primitive array parameter types - #499

Merged
hellodigua merged 2 commits into
ChatLab:mainfrom
moesnow:fix/mcp-schema-arrays
Oct 21, 2026
Merged

hellodigua merged 2 commits into
ChatLab:mainfrom
moesnow:fix/mcp-schema-arrays

Conversation

@moesnow

@moesnow moesnow commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

The official MCP server exposes search_messages.keywords, deep_search_messages.keywords, and get_message_context.message_ids as strings, so clients cannot pass the arrays expected by the tool handlers.

This change converts arrays with string, number, or boolean items to the corresponding Zod array schema. Unsupported item types (including render_chart.rows objects), missing items, and other unsupported arrays retain the existing string/enum fallback. Scalar, enum, required/optional, description, and default handling remain unchanged.

Adds behavior-based unit regressions and an integration test using the real MCP SDK in-memory transport and SQLite to verify tools/list, tools/call validation, and actual results for all three affected tools.

Validation:

  • 54 tests passed across MCP schema/server/runtime, analysis tools, CoreDataProvider, and render_chart.
  • pnpm run type-check:node
  • Targeted ESLint and Prettier checks
  • git diff --check

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T13:04:23.606204Z 7c53629 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@hellodigua

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 7c53629cac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@hellodigua
hellodigua merged commit faed80c into ChatLab:main Oct 21, 2026
1 check passed
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.

2 participants