get_resource
Retrieve detailed information about a specific Azure resource using its full resource ID to analyze infrastructure components.
Instructions
Get detailed information about a specific Azure resource
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| resourceId | Yes | Full Azure resource ID |
Implementation Reference
- src/server.ts:357-370 (registration)Registration of the 'get_resource' tool in the ListTools response, including name, description, and input schema definition.{ name: 'get_resource', description: 'Get detailed information about a specific Azure resource', inputSchema: { type: 'object', properties: { resourceId: { type: 'string', description: 'Full Azure resource ID', }, }, required: ['resourceId'], }, },
- src/server.ts:452-477 (handler)Handler implementation for the 'get_resource' tool. It fetches the topology, finds the resource by ID, and returns formatted details including name, type, group, location, subscription, ID, tags, and properties.case 'get_resource': { const { resourceId } = args as { resourceId: string }; const topology = await buildTopology(); const resource = topology.nodes.find(n => n.id === resourceId); if (!resource) { throw new McpError(ErrorCode.InvalidRequest, `Resource not found: ${resourceId}`); } return { content: [ { type: 'text', text: `Resource Details:\n\n` + `Name: ${resource.name}\n` + `Type: ${resource.type}\n` + `Resource Group: ${resource.resourceGroup}\n` + `Location: ${resource.location}\n` + `Subscription: ${resource.subscriptionId}\n` + `ID: ${resource.id}\n\n` + (resource.tags ? `Tags: ${JSON.stringify(resource.tags, null, 2)}\n\n` : '') + (resource.properties ? `Properties: ${JSON.stringify(resource.properties, null, 2)}` : ''), }, ], }; }