Skip to main content
Glama

Set Declaration

set_declaration
DestructiveIdempotent

Sets the name, type, scope, and parameters of the current Xojo method or property, completing blank items created in the IDE. Pass current values to keep fields unchanged.

Instructions

Sets the name, type, scope and parameters of the CURRENT method or property in the Xojo IDE. This is the other half of create_project_item: DoCommand "NewProperty" creates a blank, untyped property, and this is what names and types it. NOTE the two argument meanings — for a METHOD, parameters is the parameter list ('x As Integer, y As Integer') and data_type is the return type; for a PROPERTY, parameters is the DEFAULT VALUE and data_type is the property's type. Every field is replaced, so pass the current values of those you are keeping. Returns 'OK: '. A constant or other item kind is refused with an error that names it, as is a location that does not exist. The change stays in the IDE until save_project. Needs the Xojo IDE running with the project open.

Input Schema

NameRequiredDescriptionDefault
nameYesThe method's or property's name, new or unchanged
scopeNo'Public' (default), 'Protected' or 'Private'
locationNoDot-separated path to select first (e.g. 'Window1.MyMethod'). Omit to act on whatever is already current — which is what you want directly after create_project_item.
data_typeNoFor a property, its type ('String', 'Integer'). For a method, its return type. Omit for a method that returns nothing.
implementsNoInterface member this implements, e.g. 'Readable.Read'. Omit if none.
parametersNoFor a method, the parameter list ('x As Integer, y As Integer'). For a property, the default value.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv3.7.1
    • changedInput schema / properties / implements / description
      Previous value: -"Interface member this implements, e.g. 'Readable.Read'"New value: +"Interface member this implements, e.g. 'Readable.Read'. Omit if none."
    • changedInput schema / properties / name / description
      Previous value: -"New name for the method or property"New value: +"The method's or property's name, new or unchanged"
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and idempotentHint=true, and the description adds real context beyond them: 'Every field is replaced, so pass the current values of those you are keeping', the 'OK: <location>' return value, the named error cases, and that the change stays in the IDE until save_project. That is exactly the behavioral disclosure an agent needs before invoking a destructive mutation.

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?

Front-loaded with the action and the sibling relationship, and every sentence carries distinct information (semantics warning, replace-all behavior, return value, error cases, save requirement). It is dense but not padded; the packed NOTE sentence is the only mild readability cost.

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 six-parameter destructive mutation with no output schema, the description covers the return value, failure modes, persistence semantics, the create_project_item workflow, and the environment prerequisite. 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, but the description adds genuine semantic disambiguation with the NOTE that `parameters` and `data_type` swap meaning between a method and a property — the most likely source of a mis-call. It reinforces rather than merely repeats the schema.

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?

States a specific verb (Sets) and the exact resource (name, type, scope, parameters of the current method or property) in the Xojo IDE. It also positions itself relative to create_project_item, so an agent can distinguish it from sibling tools like set_code or create_project_item without opening a schema.

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?

Gives clear context: it is the second half of the create_project_item flow ('DoCommand "NewProperty" creates a blank, untyped property, and this is what names and types it'), and it names a hard exclusion (constants or other item kinds are refused) plus the prerequisite that the Xojo IDE must be running with the project open. It does not explicitly route to a sibling for the 'change existing code' case, keeping it just short of a 5.

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