Skip to content
This repository was archived by the owner on May 13, 2026. It is now read-only.

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

Open
asandres-eng wants to merge 1 commit into
jacksteamdev: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 into
jacksteamdev:mainfrom
asandres-eng:fix/input-schema-missing-properties

Conversation

@asandres-eng

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

Copy link
Copy Markdown

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

netlify Bot commented Mar 4, 2026

Copy link
Copy Markdown

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

@istefox

istefox commented May 4, 2026

Copy link
Copy Markdown

Hi @asandres-eng — heads-up that this PR will likely sit unmerged on the unmaintained upstream (per #79, declared 2026-04-24).

The equivalent fix shipped in the community fork istefox/obsidian-mcp-connector — closes upstream #77 (openai-codex / openclaw inputSchema validation). The fork's ToolRegistry.normalizeInputSchema() ensures every tool's inputSchema carries an explicit properties key, even for no-arg tools, plus strips the empty-object form of additionalProperties (#63 from upstream). Pinned by regression tests in toolRegistry.test.ts.

If you're consuming MCP-for-Obsidian from a strict-schema client (OpenAI Codex, Letta, etc.), 0.4.0 of the fork should work directly — the surface is HTTP MCP, no SDK shims required client-side. Thanks for the PR; the original problem signal was correct.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants