***

title: update_skill_data
slug: /reference/python/agents/skill-base/update-skill-data
description: Write this skill instance's namespaced state into a FunctionResult.
max-toc-depth: 3
---------------------

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

[functionresult]: /docs/server-sdks/reference/python/agents/function-result

[ref-skillbase]: /docs/server-sdks/reference/python/agents/skill-base

Write this skill instance's namespaced state into a
[`FunctionResult`][functionresult] via `update_global_data()`.

## **Parameters**

<ParamField path="result" type="FunctionResult" required={true} toc={true}>
  The FunctionResult to add the global\_data update to.
</ParamField>

<ParamField path="data" type="dict[str, Any]" required={true} toc={true}>
  Skill state dictionary to store under the skill's namespace.
</ParamField>

## **Returns**

[`FunctionResult`][functionresult] -- The result, for method chaining.

## **Example**

```python {5}
from signalwire import FunctionResult

def _handle_increment(self, args, raw_data):
    state = self.get_skill_data(raw_data)
    count = state.get("count", 0) + 1
    result = FunctionResult(f"Count is now {count}")
    self.update_skill_data(result, {"count": count})
    return result
```