Skip to main content
Glama

Get or Set Constant

constant_value
DestructiveIdempotent

Reads or sets the value of an existing constant in the Xojo IDE project, with sets verified by reading back. Omit the value to read a constant; renaming or retyping needs an on-disk edit.

Instructions

Gets or sets the value of a project constant in the Xojo IDE. The constant must already exist in the project. A set is read back, so a name that matches no constant is reported rather than silently ignored; a get of such a name returns an empty value, the same as an empty constant. It changes the value only: to rename or retype a constant, edit its #tag Constant line on disk (scaffold_code_block writes one). A set stays in the IDE until save_project. Needs the Xojo IDE running with the project open.

Input Schema

NameRequiredDescriptionDefault
nameYesConstant name, fully qualified, e.g. 'App.kVersion' or 'Module1.kLimit'; a bare name may not resolve
valueNoNew value, as text. Omit to read the current value instead.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv3.7.1
    • changedInput schema / properties / name / description
      Previous value: -"Simple or fully qualified constant name (e.g. 'kVersion' or 'App.kVersion')"New value: +"Constant name, fully qualified, e.g. 'App.kVersion' or 'Module1.kLimit'; a bare name may not resolve"
    • changedInput schema / properties / value / description
      Previous value: -"If provided, sets the constant; if omitted, returns current value"New value: +"New value, as text. Omit to read the current value instead."
  2. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Adds substantial behavior beyond the annotations: a set is read back so a non-matching name is reported rather than silently ignored, a get of an unknown name returns empty (indistinguishable from a genuinely empty constant), and a set persists only until save_project. These are non-obvious failure and persistence semantics an agent would otherwise have to discover by experiment. Consistent with destructiveHint=true and idempotentHint=true, since the operation overwrites an existing value in place.

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?

Five tight sentences, front-loaded with the get/set purpose, then the existence requirement, then failure semantics, then the rename escape hatch, then persistence and prerequisites. No sentence is redundant and no filler is present.

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?

For a two-parameter mutation tool with no output schema, the description covers everything an agent needs: prerequisites (IDE running, project open), what is mutated and what is not, what happens on a miss for both modes, when the change becomes durable (save_project), and where to go for rename/retype. Nothing material is missing.

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?

Schema coverage is 100%, so the baseline is 3, and the description earns above that by explaining the dual get/set mode and what omitting value means operationally, plus the difficulty of resolving bare names against a nonexistent constant. It does not add format or syntax detail beyond what the schema's fully-qualified-name example already provides.

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

Purpose4/5

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

States a specific verb+resource pair: gets or sets the value of a project constant in the Xojo IDE, with the constraint that the constant must already exist. It distinguishes itself from the closest sibling (property_value for properties, scaffold_code_block for editing #tag Constant lines) implicitly through the rename guidance, though it never names those siblings directly.

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

Usage Guidelines4/5

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

Clear about scope: value changes only, not rename or retype, and it names the alternative route for those (edit the #tag Constant line on disk, which scaffold_code_block writes). It also states the prerequisite of a running IDE with the project open. It lacks an explicit 'use X instead for properties' redirection to the closest sibling, which keeps it from a 5.

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