Search refuses an over-long query and tells your agent how to split it
Agents sometimes paste a whole case description into search: the parties, the facts, the dispute, a paragraph or more. The corpora behind search refuse a query longer than 500 characters. Until today that refusal came back from inside the corpus as an untyped error, and the gateway counted it as a source failure. The agent saw "all resolved MCP endpoints failed", or a case-law leg reported as unavailable, and had every reason to read it as an outage. Repeated refusals could also hold that corpus back from other searches for a short while.
The gateway now checks the length itself. A search or search_guidance query over 500 characters is refused before any source is searched, so no corpus is called and none is marked as failing. The tool result has isError: true and carries this body:
{
"error": "validation_error",
"code": "query_too_long",
"max_chars": 500,
"query_chars": 712,
"message": "query is 712 characters; search accepts at most 500, so nothing was searched. Split the matter into separate issue queries of 2-5 legal terms, one call per issue, and merge the results. Do not send a truncated copy of the text: a cut-down description does not search better.",
"dispatched": false,
"automatic_retry": false
}
The query parameter of both tools now states the limit, so an agent that reads tools/list knows it before the first call. If your client caches tool definitions, refresh the connector to pick up the new wording.
What your agent should do with a case description: list the legal issues it raises and search each one in its own call, with 2 to 5 legal terms in the language of the corpus, then merge the answers. Do not send a shortened copy of the description. We tested that on Dutch case law: the opening of an intake text names the parties and the setting, the search ranks on those words, and the decisions that matter rarely come back. Short issue queries were the only approach we tested that found them in useful numbers.
Hand your agent the pattern with the case:
Using Ansvar, list the legal issues this case description raises and search Dutch case law for each one separately with a few legal terms, such as "ontslag op staande voet" or "dringende reden". Merge the results and cite each decision.
The limit and the error are on the tool reference.