Skip to main content
Glama

Set variable

set_variable

Create or update a variable by name on any sprite or the Stage in Scratch .sb3 projects.

Instructions

Create or update a variable on a target by name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
valueYes
targetYesSprite name, or "Stage".
Behavior3/5

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

With no annotations provided, the description carries the burden of disclosing behavior. It clearly discloses that the operation mutates state by creating or updating a variable, but it does not mention edge cases, overwrite semantics beyond 'update', target existence requirements, or any return behavior.

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 a single front-loaded sentence with no wasted words. It communicates the operation, scope, and key parameter roles without redundancy.

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

Completeness4/5

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

For a simple three-parameter mutation tool, the description plus schema covers the essential invocation details: what to target, what variable name, and what value. It is slightly incomplete in that it offers no explicit guidance on when not to use it or how it interacts with sibling variable tools, but those gaps are minor for this level of complexity.

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

Parameters3/5

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

Schema description coverage is only 33% because only target has a description. The phrase 'by name' clarifies the role of the name parameter and 'on a target' clarifies target scoping, but the value parameter is left only to its obvious meaning and the schema's type union.

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 states a clear action ('Create or update') and a specific resource ('a variable on a target by name'). It distinguishes the tool from delete_variable and other sibling mutation tools because it explicitly covers both creation and update behavior.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives such as delete_variable, nor any exclusions or prerequisites. The intended use can be inferred from the name and siblings, but the description itself is silent on routing.

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/AstroBlocksMod/ScratchMCP'

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