Skip to main content
Glama

associations_of

Retrieve all ActiveRecord associations for a Rails model, including has_many, has_one, belongs_to, HABTM, and reverse references from other models.

Instructions

Rails-specific: all ActiveRecord associations on a model.

Returns outgoing has_many/has_one/belongs_to/HABTM plus reverse-references (other models that point at this one).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations, the description carries the full burden. It states the tool returns association data but does not explicitly confirm it is read-only or disclose any side effects. The behavioral context is adequate but could be more explicit about safety.

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?

The description is two concise sentences: the first states the purpose, the second details the output. It is front-loaded and efficient with no fluff.

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?

Given the has output schema (though not provided) and simple single-parameter input, the description sufficiently explains the tool's function and output types. It covers the key aspects without needing examples.

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?

The input schema has a single 'model' parameter with no description. The description adds meaning by indicating it takes a model name, but does not provide format or examples. Value is added but limited, as the schema coverage is 0%.

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 clearly states the tool is Rails-specific and enumerates the types of ActiveRecord associations returned, including outgoing and reverse-references. This is a specific verb-resource combination that distinguishes it from sibling tools like 'find_references' or 'graph_stats' which likely have different scopes.

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

Usage Guidelines3/5

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

The description implies usage for Rails models but does not explicitly state when to use this tool versus alternatives like 'find_references' or 'impact_of'. No exclusions or conditions are provided, leaving the agent to infer context.

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/Samagra001/claude-code-graphdb'

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