Prerequisites
Toolbox version
1.1.0
Environment
- MacOS 26.3.1 (a)
- 1.1.0 Binaries via Homebrew (1.1.0+dev.darwin.arm64)
Client
Came up when using Codex (0.128.0), which chokes on the null, verified with manual toolbox CLI use
Tool config:
---
kind: tool
name: query_readonly_sql
type: postgres-execute-sql
source: u1
description: >
Execute SQL through the read-only PostgreSQL role only. Intended for SELECT,
WITH SELECT-only queries, EXPLAIN, SHOW, and schema/data inspectio.
annotations:
readOnlyHint: true
destructiveHint: false
idempotentHint: true
openWorldHint: false
Expected Behavior
A zero-row SQL result from postgres-execute-sql should be represented as an empty list, which would be consistent with other tools (e.g., postgres-list-tables) and allow the client to distinguish empty results from unknown errors
Current Behavior
When a postgres-execute-sql tool returns zero rows, Toolbox returns a null tool result payload over MCP.
Steps to reproduce?
- Configure a postgres-execute-sql tool
- Run a
SELECT query returning no results, e.g. invoke query_readonly_sql '{"sql": "select 1 where false"}'
- Observe null in response (and not
[])
Additional Details
Similar to #2027
Prerequisites
Toolbox version
1.1.0
Environment
Client
Came up when using Codex (0.128.0), which chokes on the null, verified with manual toolbox CLI use
Tool config:
Expected Behavior
A zero-row SQL result from postgres-execute-sql should be represented as an empty list, which would be consistent with other tools (e.g., postgres-list-tables) and allow the client to distinguish empty results from unknown errors
Current Behavior
When a postgres-execute-sql tool returns zero rows, Toolbox returns a null tool result payload over MCP.
Steps to reproduce?
SELECTquery returning no results, e.g.invoke query_readonly_sql '{"sql": "select 1 where false"}'[])Additional Details
Similar to #2027