Repository navigation
Publish a schema for --json output and MCP tool results (outputSchema) #2364
cpeaustriajc
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
What I'd like
A published schema for what agent-browser returns, the way
agent-browser.schema.jsonalready covers the config file:--jsonenvelope (success,data,error, and error fields such ascode) and for each command'sdata, versioned with each release.outputSchemaon each MCP tool, describing thestructuredContentit already returns.Why
We wrap agent-browser in a test-runner engine. Every reply arrives as untyped JSON, so today each consumer reverse-engineers the shapes and writes its own parser. When a shape changes, nothing tells us. It happened in #785 (the
refsdict leftsnapshot --jsonin the Rust rewrite) and #1024 (snapshot -ichanged shape on some pages). A published schema would let a consumer validate replies at runtime and fail loudly, naming the field, on the first upgrade that changes a shape, instead of failing later somewhere unrelated.What I checked (0.41.1)
--jsonoutput piecemeal:data.resultanddata.unserializableforeval,data.webmcp,targetIdintab list --json,code: "tab_gone"on errors. There is no single page that describes the envelope or each command'sdata.main,typesor.d.ts.agent-browser mcp --tools alllists 64 tools. Every one has a strictinputSchema, and none has anoutputSchema. Yetagent-browser mcp call agent_browser_tools_profiles '{}'returnsstructuredContent, and the commands doc refers tostructuredContent.response.data.unserializable. So the structured shape exists but isn't declared.--jsonand MCP over stdio are the supported programmatic interfaces, so this would cover both.Happy to help with a draft if a format is preferred (a JSON Schema per command, or one generated from the Rust types).
All reactions