fix: ensure inputSchema always includes properties key for OpenAI-compatible clients#70
Open
asandres-eng wants to merge 1 commit intojacksteamdev:mainfrom
Open
Conversation
…patible clients
Clients like LM Studio and Claude Code require `properties` to always be
present in a tool's `inputSchema`, even when empty. Without it they throw:
request.tools.[n].input_schema.properties: Required
Two changes:
- ToolRegistry.ts: normalize `inputSchema` in `list()` by falling back to
`{}` when ArkType's toJsonSchema() omits the `properties` key (e.g. for
`Record<string, unknown>` schemas that emit `additionalProperties` only)
- plugin-templater.ts: change value imports from `obsidian` to `import type`
so the shared package can be bundled by bun compile (obsidian has no JS
entry point, only type declarations)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ Deploy Preview for superb-starlight-b5acb5 canceled.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ToolRegistry.ts: In thelist()method, normalize each tool'sinputSchemato always include apropertieskey (falling back to{}). OpenAI-compatible clients (LM Studio, Claude Code) requirepropertiesto be present even when empty — without it they throwrequest.tools.[n].input_schema.properties: Required. Root cause: ArkType'stoJsonSchema()forRecord<string, unknown>emits{"type":"object","additionalProperties":{}}with nopropertieskey.plugin-templater.ts: Change value imports from theobsidianpackage toimport type. Theobsidianpackage has"main": ""(types only, no JS entry point), so bun compile was failing to resolve it at build time. All usages were type annotations only — no runtime impact.Test plan
bun run check— no type errorsbun test— existing tests pass (4 pre-existing failures inparseTemplateParametersunrelated to these changes)bun run buildinpackages/mcp-server— binary compiles successfullylist_toolsvia MCP inspector — verify everyinputSchemahas apropertieskey, especiallyget_server_infoanddelete_active_file🤖 Generated with Claude Code