Skip to content

fix(mcp): accept stringified-object args on invoke_command - #61

Merged
runyourempire merged 1 commit into
mainfrom
fix/invoke-args-stringified-object
Jul 21, 2026
Merged

fix(mcp): accept stringified-object args on invoke_command#61
runyourempire merged 1 commit into
mainfrom
fix/invoke-args-stringified-object

Conversation

@runyourempire

Copy link
Copy Markdown
Collaborator

Summary

Some MCP clients stringify structured tool parameters. Live 4DA dogfood (2026-07-21): Claude Code sent args as the JSON string "{\"days\":7,\"maxNodes\":150}" and every invoke_command call bounced with the object-contract error, forcing agents to fall back to eval_js + __TAURI_INTERNALS__.invoke — exactly the workaround Victauri exists to obsolete.

A string that parses to a JSON object is now accepted as that object — the same liberal-in paper-cut class as query_db's documented sql alias, in the same file. Scalars, arrays, and non-object strings stay rejected; the error message now states both accepted forms; the args schema doc advertises the string form.

Verification

  • victauri-plugin lib: 378 passed / 0 failed (2 new tests: object ≡ stringified-object equivalence incl. absent-args; rejection table for scalar/array/non-JSON/stringified-array/stringified-scalar)
  • cargo clippy --workspace --all-targets: clean · cargo fmt --all: clean

🤖 Generated with Claude Code

https://claude.ai/code/session_01GKdeUcrRmtKubMEHoGdmmY

Some MCP clients stringify structured tool parameters — live 4DA dogfood
2026-07-21: Claude Code sent args as the JSON string "{\"days\":7,...}" and
every invoke_command call bounced with the object-contract error, forcing
agents to fall back to eval_js + __TAURI_INTERNALS__.invoke. A string that
parses to a JSON object is now accepted as that object (same liberal-in
paper-cut class as query_db's `sql` alias); scalars, arrays, and non-object
strings stay rejected, with the error text updated to state the accepted
forms.

victauri-plugin lib: 378 passed / 0 failed; clippy --workspace
--all-targets clean; fmt clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GKdeUcrRmtKubMEHoGdmmY
@runyourempire
runyourempire merged commit 9f9bd83 into main Jul 21, 2026
19 of 20 checks 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.

1 participant