***

title: update_global_data
slug: /reference/python/agents/agent-base/update-global-data
description: Update the global data dictionary with new values.
max-toc-depth: 3
---------------------

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

[set-global-data]: /docs/server-sdks/reference/python/agents/agent-base/set-global-data

[ref-agentbase]: /docs/server-sdks/reference/python/agents/agent-base

Update the global data with new values. Functionally identical to
[`set_global_data()`][set-global-data] --
both merge the provided dictionary into the existing global data.

## **Parameters**

<ParamField path="data" type="dict[str, Any]" required={true} toc={true}>
  Dictionary of key/value pairs to merge into global data.
</ParamField>

## **Returns**

[`AgentBase`][ref-agentbase] -- Returns self for method chaining.

## **Example**

```python {10}
from signalwire import AgentBase
from signalwire.core.function_result import FunctionResult

agent = AgentBase(name="support", route="/support")
agent.set_prompt_text("You are a helpful assistant.")

@agent.tool(description="Authenticate the caller")
def authenticate(args, raw_data=None):
    user = {"name": "Alice", "tier": "gold"}  # Replace with your user lookup
    agent.update_global_data({
        "authenticated": True,
        "user_name": user["name"],
        "user_tier": user["tier"]
    })
    return FunctionResult(f"Welcome back, {user['name']}.")

agent.serve()
```