> 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. # setMetadata > Set function-scoped metadata key-value pairs. [functionresult]: /docs/server-sdks/reference/typescript/agents/function-result Set function-scoped metadata key-value pairs. Metadata is scoped to the current function's `meta_data_token`, so each function maintains its own independent metadata store. Maps to the `set_meta_data` SWML action. ## **Parameters** **`data`** `Record` — required Object of key-value pairs to store as metadata. --- ## **Returns** [`FunctionResult`][functionresult] -- `this`, for chaining. ## **Example** ```typescript {4} import { FunctionResult } from '@signalwire/sdk'; const result = new FunctionResult() .setMetadata({ department: 'sales', priority: 'high' }); ``` > Set function-scoped metadata key-value pairs.