Skip to main content
Glama

kg_get_relationships

Read-onlyIdempotent

Get relationships for a specific entity from Knowledge Graph.

USE WHEN:

  • 'Кто работает над X?' - filter by works_on

  • 'С кем общался Y?' - filter by discussed_with

  • 'Кто из компании Z?' - filter by member_of

  • 'Что связано с W?' - no filter, get all

REQUIRES: entity_id from previous kg.find_entity step. Use: {{step_N.entity_id}} where N is the find_entity step number.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum relationships to return (1-50). Default: 20
directionNoRelationship direction: - 'outgoing': Entity → Others - 'incoming': Others → Entity - 'both': All relationships (default)both
entity_idYesEntity ID from kg.find_entity step. Use {{step_N.entity_id}} reference.
in_workspaceNoRun this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected.
relation_typesNoFilter by relationship types (optional): People: works_on, works_for, member_of, manages, knows, client_of, provides_service Communication: discussed_with, participated_in, mentioned_in Org/Project: developed_by, funded_by, partnered_with, integrates_with, depends_on, part_of Document: issued_by, issued_to, signed_by, authored_by Other: uses, located_in, about, follows, owns, related_to

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / in_workspace
      Added value: +{
      +  "description": "Run this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected.",
      +  "type": "integer"
      +}
  2. Added
  3. Removed
  4. First observed

TDQS

A4.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is fully covered. The description adds the dependency chain from find_entity, but nothing about return shape, pagination against the limit, or error behavior. With annotations carrying the safety burden, this is adequate but not rich.

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 one-line purpose followed by labelled USE WHEN and REQUIRES blocks that are skimmable. Every example earns its place by tying a question to a filter value, though the mixed-language phrasing is slightly quirky for a machine reader.

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?

Full schema coverage plus annotations cover parameters and safety for this read-only tool. The one gap is the absence of any statement about the response shape (entities vs. edges) with no output schema to compensate, but the usage context is otherwise complete.

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 description coverage is 100%, so the baseline is 3; the description rises above it by translating natural-language intents into concrete relation_types values, which the schema only lists abstractly. It does not, however, add anything beyond the schema for direction, limit, or in_workspace.

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 ('Get relationships for a specific entity from Knowledge Graph') with clear scope. It distinguishes itself from the sibling kg_find_entity by naming it as the required upstream step. An agent can tell exactly what this returns without opening the 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?

A 'USE WHEN' block maps concrete user intents to relation_types filters (works_on, discussed_with, member_of, or no filter for all). It also names the alternative/predecessor explicitly via 'REQUIRES: entity_id from previous kg.find_entity step', leaving nothing to inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.