Skip to main content
Glama

write_variable

Write a value to a C/C++ variable on a halted target. Specify the variable name and value as integer, float, or string to modify program state during debugging.

Instructions

Write a value to a C/C++ variable on the target.

The target must be halted (stopped) for variable writes to work.

Args: name: Variable name as it appears in source code value: Value to write (integer, float, or string representation)

Returns: Confirmation with the new value

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
valueYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations provided, so the description carries full behavioral burden. It discloses the required halted state and that it writes an integer, float, or string. It does not mention error handling, permissions, or side effects, leaving some behavioral gaps.

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

Conciseness5/5

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

The description is concise: two sentences of purpose and precondition, followed by concise param and return descriptions. No unnecessary words, and key info is front-loaded.

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

Completeness3/5

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

While the description covers purpose, precondition, and param formats, it lacks details on error conditions (e.g., if variable is undefined or read-only) and impact on target state. Output schema exists, so return info is covered, but more context would improve completeness.

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

Parameters4/5

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

With 0% schema description coverage, the description adds critical semantics by explaining that 'name' is the variable name as in source code and 'value' can be integer, float, or string representation. This goes beyond the schema's bare type string, though format details are lacking.

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?

The description clearly states 'Write a value to a C/C++ variable on the target', which specifies the action and resource. It distinguishes from sibling tools like read_variable (read) and write_register (write to register) by explicitly mentioning C/C++ variable.

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

Usage Guidelines3/5

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

The description includes a key precondition: 'The target must be halted (stopped) for variable writes to work.' However, it does not provide guidance on when to use this tool over alternatives like var_set or write_register, nor does it specify when not to use it.

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/YangPan2020/debugforge'

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