server: (tools) add x-tool-cwd header (#26420)

* server: (tools) add x-tool-cwd header

* reuse str_to_lower from server-models
This commit is contained in:
Xuan-Son Nguyen
2026-08-03 10:47:21 +02:00
committed by GitHub
parent 4ed2b13f75
commit f2b52a87e8
3 changed files with 75 additions and 13 deletions
+3
View File
@@ -199,6 +199,9 @@ Invoke a tool call, request body is a JSON object with:
- `tool` (string): the name of the tool
- `params` (object): a mapping from argument name (string) to argument value
Headers:
- `x-tool-cwd`: optional; if set, use as the CWD for tool; this is not part of tool's params because it's meant to be set by the runtime, not the LLM itself
Returns JSON object. There are two response formats (MCP tools use the same two formats: their result content is concatenated into `plain_text_response`, and RPC or tool errors are surfaced as the `error` string):
Format 1: Plain text. The text will be placed into a field called `plain_text_response`, example: