> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # toDict > Serialize a FunctionResult to the SWAIG response format. Serialize to the JSON structure expected by SWAIG. Called automatically when the result is returned from a tool function -- you rarely need to call this directly. The output contains `response` (if set), `action` (if any actions were added), and `post_process` (only when `true` and actions are present). If neither `response` nor `action` is present, defaults to `{"response": "Action completed."}`. ## **Parameters** None. ## **Returns** `Record` -- SWAIG-formatted response object. ## **Example** ```typescript {6} import { FunctionResult } from '@signalwire/sdk'; const result = new FunctionResult('Order confirmed.') .updateGlobalData({ order_id: '12345' }); const serialized = result.toDict(); console.log(serialized); ``` > Serialize a FunctionResult to the SWAIG response format.