# set_variable

> Page: https://docs.flung.dev/mcp/tools/set-variable. Index of every page: https://docs.flung.dev/llms.txt

Set a workspace variable. Sets the value of a {{name}} placeholder for new posts.

## TL;DR

| Question | Answer |
|---|---|
| What does it do? | Sets the value of a {{name}} placeholder for new posts. |
| Does it change anything? | Changes something; safe to repeat. |
| Which endpoint does it call? | [`PUT /v1/variables/{name}`](https://docs.flung.dev/reference/api/put-v1-variables-name.md) |
| Which server? | `https://mcp.flung.dev/mcp-oauth` (sign in) or `https://mcp.flung.dev/mcp` (API key). |

## Arguments

| Argument | Type | Required | Description |
|---|---|---|---|
| `name` | `string` | yes | pattern `^[A-Za-z][A-Za-z0-9_]{0,39}$`. |
| `value` | `string` | yes | at most 2000 characters. |

## Example call

```json
{
  "name": "set_variable",
  "arguments": {
    "name": "brand",
    "value": "Flung"
  }
}
```

## Things a person might say

- "Set our hashtag variable to #flung."

## Annotations

| Hint | Value |
|---|---|
| `readOnlyHint` | false |
| `destructiveHint` | false |
| `idempotentHint` | true |
| `openWorldHint` | false |

## See also

| Doc | Why |
|---|---|
| [MCP tools](https://docs.flung.dev/mcp/tools.md) | Every tool |
| [Connect an AI agent](https://docs.flung.dev/mcp.md) | Install the server in your client |
| [`PUT /v1/variables/{name}`](https://docs.flung.dev/reference/api/put-v1-variables-name.md) | The same operation over HTTP |
