Skip to main content
Glama
dhippley

Azure Topology Graph MCP Server

by dhippley

search_resources

Search Azure resources by name, type, or properties to find infrastructure components for analysis and visualization.

Instructions

Search Azure resources by name, type, or other properties

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query (searches name, type, resource group, location, tags)
resourceTypeNoOptional filter by resource type

Implementation Reference

  • The core handler function `searchResources` that builds the topology graph if needed and filters resources matching the query across name, type, resource group, location, and tags, with optional type filter.
    async function searchResources(query: string, resourceType?: string): Promise<GraphNode[]> { const topology = await buildTopology(); const searchLower = query.toLowerCase(); return topology.nodes.filter(node => { const matchesQuery = node.name.toLowerCase().includes(searchLower) || node.type.toLowerCase().includes(searchLower) || node.resourceGroup.toLowerCase().includes(searchLower) || node.location.toLowerCase().includes(searchLower) || (node.tags && Object.values(node.tags).some(tag => tag.toLowerCase().includes(searchLower) )); const matchesType = !resourceType || node.type.toLowerCase().includes(resourceType.toLowerCase()); return matchesQuery && matchesType; }); }
  • Input schema definition for the search_resources tool.
    inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query (searches name, type, resource group, location, tags)', }, resourceType: { type: 'string', description: 'Optional filter by resource type', }, }, required: ['query'], },
  • src/server.ts:339-356 (registration)
    Registration of the search_resources tool in the ListTools handler, providing name, description, and schema.
    { name: 'search_resources', description: 'Search Azure resources by name, type, or other properties', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query (searches name, type, resource group, location, tags)', }, resourceType: { type: 'string', description: 'Optional filter by resource type', }, }, required: ['query'], }, },
  • Dispatch handler in the CallToolRequestSchema that invokes searchResources and formats the MCP response.
    case 'search_resources': { const { query, resourceType } = args as { query: string; resourceType?: string }; const results = await searchResources(query, resourceType); return { content: [ { type: 'text', text: `Found ${results.length} resources matching "${query}":\n\n` + results.map(r => `• ${r.name} (${r.type})\n Resource Group: ${r.resourceGroup}\n Location: ${r.location}\n ID: ${r.id}` ).join('\n\n'), }, ], }; }

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