---
title: "get_variable"
description: "Fetch a single variable with all its per-variant values."
sidebarTitle: "get_variable"
lastUpdated: "2026-09-23"
---

> **For AI agents:** the complete documentation index is at [llms.txt](/llms.txt). Append `.md` to any page URL for its markdown version.

{/* GENERATED FILE: do not edit by hand. Regenerate with: node scripts/generate.mjs */}

Fetch a single variable with all its per-variant values.

<Note>
  **Read-only · Calls external systems.** Safe to call: this tool does not modify data.
</Note>

## Parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `variable_id` | number | Yes | Variable id |
| `with_usage` | boolean | No | If true, augment the response with the list of tests using this variable. Default false. |

## Example arguments

Illustrative arguments an agent supplies when calling this tool:

```json
{
  "variable_id": 0
}
```

## Description

```text
Secrets remain masked.

Compact by default — returns just the variable. Set with_usage=true to also embed the list of tests referencing it; the response is then wrapped as {variable, usage}.
```

## What's next?

<Columns cols={2}>
  <Card title="All MCP tools" icon="robot" href="/mcp/tools/overview">
    Browse the full tool reference by category.
  </Card>
  <Card title="Connect a client" icon="plug" href="/mcp/connect">
    Point Claude, Cursor, or Claude Code at the server.
  </Card>
</Columns>
