fix(mcp): accept stringified-object args on invoke_command - #61
Merged
Conversation
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
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
Some MCP clients stringify structured tool parameters. Live 4DA dogfood (2026-07-21): Claude Code sent
argsas the JSON string"{\"days\":7,\"maxNodes\":150}"and everyinvoke_commandcall bounced with the object-contract error, forcing agents to fall back toeval_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 documentedsqlalias, in the same file. Scalars, arrays, and non-object strings stay rejected; the error message now states both accepted forms; theargsschema doc advertises the string form.Verification
victauri-pluginlib: 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