Skip to content

Pretty-print Context surface Result as readable JSON #3

@jeremyplichta

Description

@jeremyplichta

Reported by Joe Dickey.

The Context surface currently renders Result as a single escaped JSON string inside another object, which makes the payload difficult to inspect.

Request
Would it be possible to format the Context surface Result in a more readable JSON format?

Current output example

{
  "result": "content='{\"count\": 4, \"has_more\": false, \"limit\": 10, \"offset\": 0, \"results\": [{\"cancellation_reason\": null, \"cancelled_at\": null, \"city\": \"San Francisco\", \"customer_id\": \"CUST_DEMO_001\", \"delivered_at\": \"2026-03-24T20:07:24.888747+00:00\", \"delivery_address\": \"742 Evergreen Terrace, SF, CA 94110\", \"driver_id\": \"DRV_002\", \"driver_name\": \"Priya Sharma\", \"estimated_delivery\": \"2026-03-24T20:10:24.888747+00:00\", \"id\": \"reddash_order:ORD_002\", \"items_summary\": \"Margherita Pizza, Caesar Salad\", \"order_id\": \"ORD_002\", \"order_total\": 38, \"placed_at\": \"2026-03-24T19:35:24.888747+00:00\", \"restaurant_id\": \"REST_002\", \"restaurant_name\": \"Bella Napoli\", \"status\": \"delivered\"}, {\"cancellation_reason\": null, \"cancelled_at\": null, \"city\": \"San Francisco\", \"customer_id\": \"CUST_DEMO_001\", \"delivered_at\": \"2026-03-21T20:03:24.888747+00:00\", \"delivery_address\": \"742 Evergreen Terrace, SF, CA 94110\", \"driver_id\": \"DRV_001\", \"driver_name\": \"Marcus Johnson\", \"estimated_delivery\": \"2026-03-21T20:00:24.888747+00:00\", \"id\": \"reddash_order:ORD_003\", \"items_summary\": \"Classic Burger, Fries, Milkshake\", \"order_id\": \"ORD_003\", \"order_total\": 22.99, \"placed_at\": \"2026-03-21T19:35:24.888747+00:00\", \"restaurant_id\": \"REST_005\", \"restaurant_name\": \"Burger Barn\", \"status\": \"delivered\"}, {\"cancellation_reason\": null, \"cancelled_at\": null, \"city\": \"San Francisco\", \"customer_id\": \"CUST_DEMO_001\", \"delivered_at\": \"2026-03-16T19:57:24.888747+00:00\", \"delivery_address\": \"742 Evergreen Terrace, SF, CA 94110\", \"driver_id\": \"DRV_002\", \"driver_name\": \"Priya Sharma\", \"estimated_delivery\": \"2026-03-16T19:55:24.888747+00:00\", \"id\": \"reddash_order:ORD_004\", \"items_summary\": \"Veggie Burger, Side Salad\", \"order_id\": \"ORD_004\", \"order_total\": 15.99, \"placed_at\": \"2026-03-16T19:35:24.888747+00:00\", \"restaurant_id\": \"REST_005\", \"restaurant_name\": \"Burger Barn\", \"status\": \"delivered\"}, {\"cancellation_reason\": null, \"cancelled_at\": null, \"city\": \"San Francisco\", \"customer_id\": \"CUST_DEMO_001\", \"delivered_at\": null, \"delivery_address\": \"742 Evergreen Terrace, SF, CA 94110\", \"driver_id\": \"DRV_001\", \"driver_name\": \"Marcus Johnson\", \"estimated_delivery\": \"2026-03-26T19:05:24.888747+00:00\", \"id\": \"reddash_order:ORD_001\", \"items_summary\": \"Spicy Tuna Roll x2, Miso Soup, Edamame\", \"order_id\": \"ORD_001\", \"order_total\": 42.5, \"placed_at\": \"2026-03-26T18:25:24.888747+00:00\", \"restaurant_id\": \"REST_001\", \"restaurant_name\": \"Sakura Sushi\", \"status\": \"in_transit\"}], \"total_count\": 4}' name='filter_order_by_customer_id' tool_call_id='call_MH8U9RnC7vuOo9NW56nAuV8y'"
}

Expected behavior

  • Render JSON payloads in a pretty-printed, readable format.
  • Avoid double-encoding or excessive escaping when the underlying value is JSON.
  • If the raw string still needs to be available, keep it secondary to the formatted view.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions