Skip to main content
Glama

find_references

Read-only

Locate all references to X++ classes, methods, fields, tables, enums, EDTs, or labels. Scope method searches by declaring type to avoid over-reporting.

Instructions

Find all references (where-used) to a class, method, field, table, enum, EDT, or LABEL. For a method, SCOPE it to its declaring type — pass "Owner.method" (e.g. "SalesTable.initFromSalesQuotationTable"), set ownerName alongside a bare method name, or pass an AOT path ("/Tables/SalesTable/Methods/initFromSalesQuotationTable"). A bare method name (no owner) matches that name on every type and over-reports. For a label, pass the label id as targetName (e.g. "@WAX2194" or "@MyLabelFile:MyLabel"); results span every referencing object type (tables, forms, EDTs, enums, reports, menu items, …), not just code, and require the xref database (DYNAMICSXREFDB, full server mode).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of references to return
ownerNameNoDeclaring table/class/form that owns the method, when targetName is the bare method name. Scopes the where-used to that single type.
targetNameYesTarget name. Methods: see the scoping rule in the description above. Labels: the id exactly as written — "@WAX2194" or "@LabelFile:LabelId".
targetTypeNoScopes a bare name to that type. An enum value: "Enum::Value" with "enum"; an index or field group: "Table.Name".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.19.1
    • removedInput schema / properties / targetType / default
      Removed value: -"all"
    • changedInput schema / properties / targetType / description
      Previous value: -"Type of the target to search for. Use \"label\" for label where-used (or just pass an \"@…\" / \"/Labels/@…\" targetName)."New value: +"Scopes a bare name to that type. An enum value: \"Enum::Value\" with \"enum\"; an index or field group: \"Table.Name\"."
    • changedInput schema / properties / targetType / enum
      Previous value: -[
      -  "class",
      -  "method",
      -  "field",
      -  "table",
      -  "enum",
      -  "edt",
      -  "form",
      -  "query",
      -  "view",
      -  "report",
      -  "label",
      -  "all"
      -]New value: +[
      +  "class",
      +  "method",
      +  "field",
      +  "table",
      +  "enum",
      +  "edt",
      +  "form",
      +  "query",
      +  "view",
      +  "data-entity",
      +  "map",
      +  "report",
      +  "menu-item",
      +  "index",
      +  "field-group",
      +  "label",
      +  "all"
      +]
  2. Changed1 schema field changedv1.14.0
    • changedInput schema / properties / targetName / description
      Previous value: -"Target name. Method where-used: qualify as \"Owner.method\" or pass an AOT path \"/Tables/<Table>/Methods/<method>\" for a result scoped to one declaring type (matches Visual Studio xref). A bare method name is name-only and over-reports. Label where-used: pass the label id exactly as written — old format \"@WAX2194\" or new format \"@LabelFile:LabelId\" (e.g. \"@ApplicationPlatform:AbortButtonText\")."New value: +"Target name. Methods: see the scoping rule in the description above. Labels: the id exactly as written — \"@WAX2194\" or \"@LabelFile:LabelId\"."
  3. First observedv1.8.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations cover the safety profile (readOnlyHint=true, openWorldHint=false), so this is a read operation. The description adds substantive behavioral context the annotations cannot: results are broad (all referencing object types for labels), bare method names over-report, and xref database/server-mode prerequisites apply. It does not discuss result volume limits or failure modes when the xref DB is unavailable.

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-loads the purpose, then the method-scoping rule, then the label rule. Dense but every sentence carries operational information (scoping forms, over-reporting warning, xref prerequisite). The long parenthetical enumeration of referencing object types is slightly verbose but functional.

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 query tool with no output schema and full schema coverage, the description covers prerequisites (xref DB, server mode), result breadth, and the most error-prone input pattern. It doesn't describe pagination interaction with the limit parameter or what a reference entry contains, which is a minor gap given there is no output schema.

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

Parameters5/5

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

Schema coverage is already 100%, but the description goes well beyond it: it explains the ownerName-vs-bare-name interaction, gives both 'Owner.method' and AOT-path forms, specifies label id syntax, and clarifies enum value formatting for targetType entries like enum, index, and field-group. This meaningfully disambiguates how to set otherwise ambiguous parameters.

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 ('Find all references (where-used)') and enumerates the exact target kinds (class, method, field, table, enum, EDT, LABEL). No sibling tool covers where-used queries, so the agent can route here unambiguously.

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 concrete when/when-not guidance: scoping a method to its declaring type via 'Owner.method', ownerName, or an AOT path, and warns that a bare method name over-reports across every type. It also states the label-specific requirement for the xref database (full server mode). It does not name alternative sibling tools to use instead, which is why it falls 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.