Run Several Queries at Once
batchRuns several read-only code queries in one round-trip on a shared session, returning each result or error so independent questions can be answered together.
Instructions
Run several read-only query tools in ONE round-trip against one shared session. measure sizes each answer instead of returning it.
Use it for questions independent of each other's answers; a solution path as sessionId is analyzed once.
queries: an array of {tool, args}; args: that tool's own arguments as a JSON object WITHOUT sessionId (omit args for a tool that takes none). Example: queries=[{"tool":"find_usages","args":{"symbol":"Foo"}},{"tool":"find_tests_for","args":{"symbol":"Foo"}}]. At most 16 per call: more fails the whole call, as does a sessionId that does not resolve.
Returns { results: [{tool, ok, result | error | omitted}], count, okCount, omittedCount (when any) }, in query order. A failing sub-query answers ok:false + error; the rest still return. A JSON tool's result nests as an object, a Markdown tool's as a string. The answers share ~9000 tokens, small ones whole first. A large answer is never cut: a 'budget' tool's may render smaller if its share reaches the tool's floor (see 'note'), else it carries 'omitted' (it ran; call it directly). Unknown arguments are ignored, named in 'note'.
Dispatchable: a fixed registry of read-only code queries, among them find_*/get_*/impact_of_change/symbol_signature/explain_symbol/calls_external/resolve_injection/symbol_metrics/list_insights. Refused per item, with the names the active profile dispatches listed: tools that mutate session state or write (analyze_solution/refresh_session/apply_solution_config/save_session/remember_codebase/export_markdown/install_agent_hooks), poor batch members (evaluate_change_set/init_solution_config/prepare_task/review_context), tools needing a second session or snapshot (semantic_diff/diff_review/verify_claim/compare_with_previous) and the session, configuration and server tools - call these directly where exposed. A tool the active MCP profile does not expose is refused too, as a direct call would be.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sessionId": "<sessionId>",
"queries": "<queries>"
},
"name": "batch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| queries | Yes | The read-only sub-queries: an array of { tool, args } objects. 'tool' is a read-only tool name; 'args' is that tool's argument object (without sessionId), omittable when the tool needs no arguments. Max 16. | |
| sessionId | Yes | The session_id returned by analyze_solution. Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use. Shared by ALL sub-queries - do NOT repeat it inside each query's args. |