***

title: updateSkillData
slug: /reference/typescript/agents/skill-base/update-skill-data
description: Write data under this skill's namespace into a FunctionResult.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

Writes data under this skill's namespace into a `FunctionResult` object.
This persists skill state across tool invocations by embedding it in the
agent's global data.

## **Parameters**

<ParamField path="result" type="FunctionResult" required={true} toc={true}>
  The FunctionResult to update with the skill's namespaced data.
</ParamField>

<ParamField path="data" type={"Record<string, unknown>"} required={true} toc={true}>
  The data to store under this skill's namespace.
</ParamField>

## **Returns**

`FunctionResult` -- The updated FunctionResult with the skill data merged in.

## **Example**

```typescript {4}
import { SkillBase } from '@signalwire/sdk';

// Inside a tool handler, persist skill state
const updatedResult = mySkill.updateSkillData(result, {
  lastQuery: 'New York',
  cachedResponse: { temp: 72, conditions: 'sunny' },
});
```