Skip to content

fix: ensure inputSchema always includes properties key for OpenAI-compatible clients#70

Open
asandres-eng wants to merge 1 commit intojacksteamdev:mainfrom
asandres-eng:fix/input-schema-missing-properties
Open

fix: ensure inputSchema always includes properties key for OpenAI-compatible clients#70
asandres-eng wants to merge 1 commit intojacksteamdev:mainfrom
asandres-eng:fix/input-schema-missing-properties

Conversation

@asandres-eng
Copy link

@asandres-eng asandres-eng commented Mar 4, 2026

Summary

  • ToolRegistry.ts: In the list() method, normalize each tool's inputSchema to always include a properties key (falling back to {}). OpenAI-compatible clients (LM Studio, Claude Code) require properties to be present even when empty — without it they throw request.tools.[n].input_schema.properties: Required. Root cause: ArkType's toJsonSchema() for Record<string, unknown> emits {"type":"object","additionalProperties":{}} with no properties key.
  • plugin-templater.ts: Change value imports from the obsidian package to import type. The obsidian package 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

  • Run bun run check — no type errors
  • Run bun test — existing tests pass (4 pre-existing failures in parseTemplateParameters unrelated to these changes)
  • Run bun run build in packages/mcp-server — binary compiles successfully
  • Call list_tools via MCP inspector — verify every inputSchema has a properties key, especially get_server_info and delete_active_file

🤖 Generated with Claude Code

…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>
@netlify
Copy link

netlify bot commented Mar 4, 2026

Deploy Preview for superb-starlight-b5acb5 canceled.

Name Link
🔨 Latest commit a541f5b
🔍 Latest deploy log https://app.netlify.com/projects/superb-starlight-b5acb5/deploys/69a79661d1b5df00080eae59

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