Run Several Queries at Once
batchRun multiple independent read-only code queries in one shared-session call, returning each result or error in order so agents avoid repeated round-trips.
Instructions
Run several read-only query tools in ONE round-trip against one shared session. measure is the sibling that reports what each answer would cost instead of returning it.
Use it whenever two or more questions do not depend on each other's answers; a solution path as sessionId is analyzed once.
queries is an array of {tool, args}: args is that tool's own arguments as a JSON object WITHOUT sessionId (omit it 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}], count, okCount }, in query order. A failing sub-query answers ok:false + error and the rest still return. A JSON tool's result is nested as an object, a Markdown tool's is the string. The answers share a response budget of about 9000 tokens: one that no longer fits is omitted with ok:false and a pointer to call that tool directly - after its work was done. 'note' on an item names arguments the tool does not have; they are ignored, not rejected.
Dispatchable is a fixed registry of read-only queries about the analyzed code, among them find_*/get_*/impact_of_change/symbol_signature/explain_symbol/calls_external/resolve_injection/symbol_metrics/list_insights. Refused per item, with the registry's names listed - call these directly where the profile exposes them: tools that mutate session state or write (such as 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. A tool the active MCP profile does not expose is refused per item too, as a direct call would be - also when a refusal's list names it.
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. |