***

title: add_swaig_query_params
slug: /reference/python/agents/agent-base/add-swaig-query-params
description: Append query parameters to all SWAIG webhook URLs.
max-toc-depth: 3
---------------------

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

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

Add query parameters that will be included in all SWAIG webhook URLs generated by
this agent. This is particularly useful for preserving dynamic configuration state
across SWAIG callbacks -- for example, passing a tenant identifier or feature tier
so the same configuration is applied when SignalWire invokes tool webhooks.

## **Parameters**

<ParamField path="params" type="dict[str, str]" required={true} toc={true}>
  Dictionary of query parameters to merge into every SWAIG URL. Subsequent calls
  merge into (not replace) the existing set. Pass the same key again to overwrite
  its value.
</ParamField>

## **Returns**

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

## **Examples**

### Preserve tier in dynamic config

```python {10}
from signalwire import AgentBase

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

def dynamic_config(query_params, body_params, headers, agent):
    tier = query_params.get("tier", "free")
    if tier == "premium":
        agent.add_skill("advanced_search")
    agent.add_swaig_query_params({"tier": tier})

agent.set_dynamic_config_callback(dynamic_config)
agent.serve()
```

### Multi-tenant routing

```python {8}
from signalwire import AgentBase

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

def dynamic_config(query_params, body_params, headers, agent):
    tenant_id = query_params.get("tenant_id", "default")
    agent.add_swaig_query_params({"tenant_id": tenant_id})

agent.set_dynamic_config_callback(dynamic_config)
agent.serve()
```