diff --git a/modules/pier/dispatch.go b/modules/pier/dispatch.go index 6353eb6d..d741125b 100644 --- a/modules/pier/dispatch.go +++ b/modules/pier/dispatch.go @@ -69,7 +69,9 @@ func (d *dispatcher) call(ctx context.Context, id Identity, info callInfo, t *to } func (d *dispatcher) run(ctx context.Context, id Identity, info callInfo, t *tool, raw json.RawMessage) (*mcp.CallToolResult, int) { - if len(bytes.TrimSpace(raw)) == 0 { + // tools/call may omit arguments (or send null) for a tool without + // required input; both mean an empty object. + if trimmed := bytes.TrimSpace(raw); len(trimmed) == 0 || bytes.Equal(trimmed, []byte("null")) { raw = json.RawMessage("{}") } var parts map[string]json.RawMessage