Skip to main content
Glama
dhippley

Azure Topology Graph MCP Server

by dhippley

get_neighbors

Find connected resources in Azure infrastructure to analyze relationships and dependencies for troubleshooting or optimization.

Instructions

Get resources connected to a specific resource

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
resourceIdYesFull Azure resource ID

Implementation Reference

  • Core handler function that retrieves the specified resource node and all directly connected neighbor nodes from the cached topology graph by scanning edges.
    async function getResourceNeighbors(resourceId: string): Promise<{node: GraphNode, neighbors: GraphNode[]}> {
      const topology = await buildTopology();
      const node = topology.nodes.find(n => n.id === resourceId);
      
      if (!node) {
        throw new McpError(ErrorCode.InvalidRequest, `Resource not found: ${resourceId}`);
      }
      
      // Find all connected nodes
      const connectedIds = new Set<string>();
      
      for (const edge of topology.edges) {
        if (edge.source === resourceId) {
          connectedIds.add(edge.target);
        } else if (edge.target === resourceId) {
          connectedIds.add(edge.source);
        }
      }
      
      const neighbors = topology.nodes.filter(n => connectedIds.has(n.id));
      
      return { node, neighbors };
  • src/server.ts:371-384 (registration)
    Tool registration entry in the ListTools response, including name, description, and input schema.
    {
      name: 'get_neighbors',
      description: 'Get resources connected to a specific resource',
      inputSchema: {
        type: 'object',
        properties: {
          resourceId: {
            type: 'string',
            description: 'Full Azure resource ID',
          },
        },
        required: ['resourceId'],
      },
    },
  • Dispatch handler in the CallToolRequestHandler switch statement that extracts arguments, calls the core getResourceNeighbors function, and formats the textual response.
    case 'get_neighbors': {
      const { resourceId } = args as { resourceId: string };
      const { node, neighbors } = await getResourceNeighbors(resourceId);
      
      return {
        content: [
          {
            type: 'text',
            text: `Resource: ${node.name} (${node.type})\n\n` +
              `Connected Resources (${neighbors.length}):\n\n` +
              neighbors.map(n => 
                `• ${n.name} (${n.type})\n  Resource Group: ${n.resourceGroup}\n  Location: ${n.location}`
              ).join('\n\n'),
          },
        ],
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'Get resources connected' but doesn't disclose behavioral traits like whether this is a read-only operation, what types of connections are considered, if there are rate limits, or how results are returned (e.g., list format). The description is minimal and leaves key behaviors unspecified.

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 a single, efficient sentence: 'Get resources connected to a specific resource'. It's front-loaded with the core action and target, with zero wasted words. Every part earns its place by conveying the essential purpose without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a tool that retrieves connected resources, with no annotations, no output schema, and minimal description, this is incomplete. The description lacks details on what 'connected' means, the return format, or any behavioral context, making it inadequate for an agent to use effectively without guesswork.

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?

Schema description coverage is 100%, with the parameter 'resourceId' documented as 'Full Azure resource ID'. The description adds no meaning beyond this, as it doesn't explain what a 'resource' entails or how connections are defined. With high schema coverage, the baseline is 3, but the description doesn't compensate with additional context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get resources connected to a specific resource' clearly states the action (get) and target (connected resources), but it's vague about what 'connected' means and doesn't distinguish from siblings like 'find_path' (which might find connection paths) or 'search_resources' (which might search broadly). It avoids tautology but lacks specificity.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention siblings like 'find_path' for pathfinding or 'get_resource' for single-resource details, nor does it specify prerequisites or exclusions. Usage is implied by the action but not explicitly defined.

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/dhippley/azure_mcp_graph'

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