Skip to content

fix: make source_ids schema provider-compatible#4

Merged
rpgeeganage merged 1 commit into
mcp-shark:mainfrom
chrythjin:fix/search-tools-source-ids-schema
May 10, 2026
Merged

fix: make source_ids schema provider-compatible#4
rpgeeganage merged 1 commit into
mcp-shark:mainfrom
chrythjin:fix/search-tools-source-ids-schema

Conversation

@chrythjin

Copy link
Copy Markdown
Contributor

Summary

  • expose search_tools.source_ids as an optional plain array schema instead of a nullable union
  • keep runtime behavior unchanged: callers can still omit source_ids when unused
  • add a regression test that asserts the emitted schema type is array

Why

The previous generated schema used type: ["null", "array"]. That is valid JSON Schema, but some MCP clients and provider function-declaration adapters reject nullable union types for tool parameters. Since source_ids is optional, it does not need to include null in the schema type.

This improves compatibility for clients that translate MCP tools into provider function declarations while preserving the existing optional argument behavior.

Verification

  • go test ./internal/mcpserver -run TestSearchToolsInputSchema_SourceIDsIsArray
  • go test ./...

Expose search_tools source_ids as an optional array instead of a nullable union so MCP clients that adapt tools to provider function declarations can accept the schema.
@rpgeeganage rpgeeganage merged commit 06cc200 into mcp-shark:main May 10, 2026
2 checks passed
@rpgeeganage

Copy link
Copy Markdown
Member

Thank you for the contribution 🙇

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