Skip to main content
Glama

list_relationships

Retrieve relationships for an entity or discover the type between two entities. Filter by source, target, direction, or relationship type with pagination support.

Instructions

List relationships for an entity, or discover the relationship type(s) between two specific entities. Filter by entity_id (with direction), or by source_entity_id and/or target_entity_id, and optionally relationship_type. To discover the type before delete_relationship, pass both source_entity_id and target_entity_id: each returned relationship carries its relationship_type. Soft-deleted relationships are excluded by default, so a deleted edge will not be re-offered for deletion; pass include_deleted: true to include them for audit. Paginated via limit/offset.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entity_idNoEntity ID to match against either the source or target of each relationship (filtered further by `direction`). Legacy filter pattern; prefer `source_entity_id` / `target_entity_id` for new code.
source_entity_idNoMatch relationships whose `source_entity_id` equals this value.
target_entity_idNoMatch relationships whose `target_entity_id` equals this value.
directionNoDirection applied when `entity_id` is set. `incoming`/`inbound` matches relationships where the entity is the target; `outgoing`/`outbound` matches relationships where the entity is the source; `both` (default) matches either side. both
relationship_typeNoOptional relationship_type filter. Closed enum matching the handler's accepted values; spec-driven clients passing any other value will be rejected at runtime with a Zod validation error.
limitNoMaximum number of relationships to return.
offsetNoNumber of relationships to skip before returning results.
include_deletedNoWhen `false` (default), soft-deleted relationships are excluded from the result. When `true`, soft-deleted edges are included (audit/history use). A relationship is soft-deleted once its highest-priority deletion observation is recorded; the snapshot row itself persists.
user_idNoOptional user_id override (scoped to callers with privilege to query on behalf of another user). When omitted, the authenticated user is used.
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses that soft-deleted relationships are excluded by default, explains the include_deleted parameter, and mentions pagination via limit/offset. It does not cover auth needs or rate limits, but the behavioral details are sufficient for most use cases.

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?

The description is extremely concise and well-structured. It starts with the main purpose, then details filtering options, a specific use case, default behavior, and pagination. Every sentence earns its place with no redundancy.

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 9 optional parameters and no output schema, the description covers the main use cases, filtering, and pagination. It mentions that each returned relationship carries its relationship_type, but does not describe the full output structure (e.g., source/target entity IDs). A brief note on the response format would improve completeness.

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%, setting a baseline of 3. The description adds value by explaining the relationship between entity_id and direction, the use case for combining source_entity_id and target_entity_id, and the meaning of include_deleted. This goes beyond the schema definitions.

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 lists relationships for an entity or discovers relationship types between two specific entities. It distinguishes between filtering modes and provides a specific use case (discovery before deletion), differentiating it from sibling tools like create_relationship or delete_relationship.

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?

The description provides explicit guidance on when to use entity_id with direction vs. source_entity_id/target_entity_id. It also includes a concrete example for discovering relationship type before deletion. However, it lacks explicit 'when not to use' or alternatives, which would elevate it to a 5.

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/markmhendrickson/neotoma'

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