Skip to main content
Glama

get_neighbors

Retrieve direct neighbors of a node—incoming and outgoing edges—grouped by type for quick graph exploration without code snippets.

Instructions

Get direct neighbors of a node — all incoming and/or outgoing edges.

Returns edges grouped by type with connected node summaries.

Use this when you need:

  • "What does this node connect to?" (outgoing)

  • "What connects to this node?" (incoming)

  • Simple graph exploration without Datalog

Direction options:

  • outgoing: Edges FROM this node (calls, contains, depends on)

  • incoming: Edges TO this node (callers, containers, dependents)

  • both: All edges (default)

Edge type filter: Pass edgeTypes to see only specific relationships. Omit to get all edge types.

Cheaper than get_context (no code snippets). Use when you only need the graph structure, not source code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
semanticIdYesSemantic ID of the node
directionNoEdge direction: outgoing, incoming, or both (default: both)
edgeTypesNoFilter by edge types (e.g., ["CALLS", "CONTAINS"]). Omit for all.
Behavior4/5

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

With no annotations, the description carries full burden. It discloses return format ('edges grouped by type with connected node summaries') and cost comparison, but does not explicitly state read-only nature or side effects. However, context implies no mutations.

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?

Front-loaded with general purpose, followed by structured sections for usage, direction, and edge types. No redundant sentences; every sentence adds information.

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 no output schema, the description adequately explains return values. It covers all usage aspects and parameters, making it complete for a graph exploration tool.

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% (baseline 3). The description adds value by explaining direction options with concrete examples (calls, contains, depends on) and edge type filter usage ('Pass edgeTypes to see only specific relationships. Omit to get all edge types.').

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 'Get direct neighbors of a node — all incoming and/or outgoing edges.' It uses a specific verb (get) and resource (direct neighbors/edges), and distinguishes itself from sibling tools like get_context by noting it is cheaper and returns no code snippets.

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?

Explicitly provides when-to-use scenarios: 'What does this node connect to?' and 'Simple graph exploration without Datalog.' It also mentions alternatives ('Cheaper than get_context') and gives direction options with examples.

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/Disentinel/grafema'

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