Skip to main content
Glama

Check references

check_references

Detects broken references in RPG Maker MV projects by flagging event commands, page conditions, and database fields that point to missing records before release.

Instructions

Finds references that point at records which do not exist: a Battle Processing (301) on a missing troop, a shop item (302/605), Change Items/Weapons/Armors (126-128), Learn/Forget Skill (318), Change State (313), Change Party Member (129) and the other actor commands, Common Event calls (117), Transfer Player (201) or Set Vehicle Location (202) to a missing map, page conditions on a missing item or actor, enemy drops and actions, class learnings, actor class and equipment, troop members, item and skill effects, map encounter lists and System startMapId and partyMembers. It uses the same index as find_usages, so it checks exactly the references find_usages lists (staged changeset data included). A record exists when its database file (Items, Weapons, Armors, Skills, States, Actors, Classes, Enemies, Troops, CommonEvents) holds a non-null row whose id field is that id (not its array position, as in find_usages), or MapInfos.json lists the map. Id 0 means 'none' (an empty equipment slot, no drop) and is never reported. Switches and variables are not checked (plain numbers; lint_events reports unnamed ones). Run it before a release and after deleting or renaming records, and use find_usages on one reported id to see every place. Returns {summary, missing: [{kind, id, count, locations, severity: 'error'}], truncated, counts: {distinctMissing, references}, notes}. missing is grouped by kind and id, ordered by kind (item, weapon, armor, skill, state, actor, class, enemy, troop, commonEvent, map) then id; count is the number of references and locations lists at most 3 of them (same format as find_usages). missing is cut at limit groups and truncated is the number cut. A database file that is missing or unreadable is named in notes and its references are NOT reported as missing. notes also state what is not checked: references made by script commands, plugin commands, notetags, plugin parameters, damage formulas, trait codes and variable-designated transfers and battles (with how many such commands the project has), and maps that could not be read.

Input Schema

NameRequiredDescriptionDefault
limitNoMost missing records (kind + id groups) returned.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.1

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does so substantively: it defines record existence (non-null row with matching id field, not array position), defines id 0 as 'none' and never reported, and states that unreadable database files go to notes rather than being reported as missing. It also discloses a major limitation class (script commands, plugin commands, notetags, damage formulas, variable-designated transfers) with counts. Minor deduction only because it doesn't characterize cost/performance on large projects.

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

Conciseness3/5

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

Front-loaded correctly — the core finding and the inclusion list come first, return shape and caveats later — but it is a single dense ~250-word paragraph with a long command-ID enumeration (301, 302/605, 126-128, 318, 313, 129, 117, 201, 202) that is hard to scan. Little is strictly redundant, but the structure is a wall of text rather than sections.

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?

Despite having no output schema, the description fully documents the return value ({summary, missing[{kind,id,count,locations,severity}], truncated, counts, notes}), the ordering (by kind then id), the 3-location cap, and the limit/truncated semantics. For a diagnostic tool with one optional parameter, nothing an agent needs to call or interpret it 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 real meaning the schema lacks: limit counts kind+id groups rather than individual references, and the overflow is exposed via 'truncated'. That disambiguates what a caller is actually capping.

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 and resource ('Finds references that point at records which do not exist') and enumerates the exact reference kinds checked. It also explicitly positions itself against the sibling find_usages ('uses the same index as find_usages, so it checks exactly the references find_usages lists'), so an agent can differentiate the two 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 Guidelines5/5

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

Gives explicit when-to-use ('Run it before a release and after deleting or renaming records') and a concrete follow-up alternative ('use find_usages on one reported id to see every place'). It also routes a related concern to another sibling ('Switches and variables are not checked ... lint_events reports unnamed ones').

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