# substitute_json

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/plugins/substitution/substitute_json)

Substitute plugin variables throughout a JSON-compatible value.

## Signature

```python
substitute_json(
    value: JsonValue,
    *,
    plugin_root: Path,
    plugin_data: Path,
    project_dir: Path | None = None,
) -> JsonValue
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `value` | `JsonValue` | Yes | JSON-compatible value to transform. |
| `plugin_root` | `Path` | Yes | Plugin root directory. |
| `plugin_data` | `Path` | Yes | Plugin data directory. |
| `project_dir` | `Path \| None` | No | Optional project directory. (default: `None`) |

## Returns

`JsonValue`

Value with strings recursively substituted.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/caaa7e7c12d214afa5cf0a1afed8eb6232aa6f7b/libs/code/deepagents_code/plugins/substitution.py#L62)