Skip to main content
Glama

tm_create_variables_set

Destructive

Creates a variables set from CSV content to replace macro placeholders in request profiles, enabling parameterized load testing.

Instructions

Create a new variables set from inline CSV content.

csv_content is the full CSV as a string — header row plus data rows. The server parses + validates at upload time and rejects malformed or oversized inputs with a typed :class:ToolError.

The header row's column names define which $$macro$$ placeholders this set substitutes when attached to a profile. Example::

userId,token,weight
u-1001,tk-abc,5
u-1002,tk-def,1

Attached to a profile whose URL is https://api.example.com/users/$$userId$$ and which sends header Authorization: Bearer $$token$$, each request:

  • Picks a row (weighted random in ROW mode — row 1 with 5/6 probability, row 2 with 1/6; sequential in SEQUENTIAL mode).

  • Substitutes the row's userId and token columns into the matching placeholders.

  • Sends the resulting request.

mode defaults to "ROW" (weighted per-row sampling). Other accepted values: "COLUMN" (per-column independent sampling) and "SEQUENTIAL" (ordered walk, for captured- traffic replay). ROW mode REQUIRES a weight column (case-insensitive header); COLUMN accepts an optional shared weight column AND per-column {col}_weight overrides; SEQUENTIAL ignores weights. See the helper docstring in _validate_variables_set_mode for the full mode contract.

Returns the created set's metadata (id, name, mode, macroColumns, weightColumn, rowCount, byteSize). The AI host typically follows with attaching the new set to a profile — that's handled via tm_update_profile on the profile side (variables-set attachment is on the profile, not the set).

Quota: each account has a per-user variables-set quota. A 400 with Variables-set quota reached means delete an existing set first.

Duplicate names rejected (strict-uniqueness semantics). Per-user, names must be unique — a second create call with a name that already exists 400s with A variables set named 'X' already exists. The endpoint deliberately doesn't auto-suffix (unlike the capture-import path which does (2), (3), …). Pick a fresh name, or :func:tm_rename_variables_set / :func:tm_delete_variables_set the existing one before re-creating.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
csv_contentYes
modeNoROW
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Adds extensive behavioral context beyond annotations: describes validation rejection, quota errors, duplicate name errors, mode-specific behavior (ROW/COLUMN/SEQUENTIAL), return value metadata, and side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with paragraphs, examples, and clear sections, but slightly long; each section adds value so a 4 is appropriate.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers creation tool comprehensively: input format, validation, errors, quotas, modes, return metadata, and links to subsequent steps (profile attachment). No output schema but description fills the gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Compensates for 0% schema coverage by thoroughly explaining 'name' (uniqueness), 'csv_content' (format, headers, data rows, placeholder mapping), and 'mode' (default, options, requirements) with examples.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Explicitly states 'Create a new variables set from inline CSV content', explains CSV format and placeholder substitution, and distinguishes from sibling tools like tm_rename_variables_set and tm_delete_variables_set.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides detailed when-to-use guidance including note about attaching via tm_update_profile, explains quota limits and duplicate name handling, and describes mode options with their behavior.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/trafficmorph-gif/tm-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server