Skip to main content
Glama
vedantparmar12

Azure Omni-Tool MCP Server

get_azure_context

Retrieve Azure environment data including subscriptions, resource groups, or custom KQL queries to analyze resources, with configurable caching for performance.

Instructions

Retrieves Azure environment context.

TYPES: subscriptions, resource_groups, resources, custom (KQL)

CACHING: 5min default, bypass_cache=true for fresh data

EXAMPLES:

  • Find VMs: custom_query = "Resources | where type == 'microsoft.compute/virtualmachines'"

  • Find by tag: custom_query = "Resources | where tags.env == 'prod'"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
query_typeYes
subscription_idNoOptional subscription scope
resource_groupNoOptional resource group filter
custom_queryNoKQL query for Resource Graph
bypass_cacheNoForce fresh data

Implementation Reference

  • Main handler function for get_azure_context tool. Dispatches to specific query handlers (subscriptions, resource_groups, resources, custom) based on input.query_type, handles caching, logging, auditing, and returns ContextResponse.
    export async function handleGetAzureContext(input: GetAzureContextInput): Promise<ContextResponse> {
        const { query_type } = input;
        const operator = getOperatorInfo();
        const audit = createAuditContext(`context:${query_type}`, 'low', 'query');
    
        logger.debug('Context query', { query_type, subscription: input.subscription_id, rg: input.resource_group });
    
        const handler = queryHandlers.get(query_type);
        if (!handler) {
            return { query_type, success: false, error: `Unknown query type: ${query_type}` };
        }
    
        const response = await handler(input);
        response.correlation_id = audit.correlationId;
        response.operator = operator;
    
        if (response.success) {
            await audit.logSuccess();
            logger.info('Context query succeeded', { query_type, count: response.count, cached: response.cached });
        } else {
            await audit.logFailure(response.error || 'Unknown');
            logger.warn('Context query failed', { query_type, error: response.error });
        }
    
        return response;
    }
  • Zod schema defining input validation for get_azure_context tool, including query_type (required), optional filters, custom_query for KQL, and cache bypass.
    export const GetAzureContextSchema = z.object({
        query_type: z.enum(['subscriptions', 'resource_groups', 'resources', 'custom']).describe('Type of context query'),
        subscription_id: z.string().optional().describe('Subscription to scope query'),
        resource_group: z.string().optional().describe('Resource group filter'),
        custom_query: z.string().optional().describe('KQL query for Resource Graph'),
        bypass_cache: z.boolean().optional().default(false).describe('Force fresh data'),
    });
  • src/index.ts:28-32 (registration)
    Tool registration in the toolRegistry Map, linking name 'get_azure_context' to its tool metadata, schema, and handler wrapper.
    ['get_azure_context', {
        tool: getAzureContextTool,
        schema: GetAzureContextSchema,
        handler: args => handleGetAzureContext(GetAzureContextSchema.parse(args))
    }],
  • Tool metadata object with name, detailed description, and JSON schema for MCP tool listing.
    export const getAzureContextTool = {
        name: 'get_azure_context',
        description: `Retrieves Azure environment context.
    
    TYPES: subscriptions, resource_groups, resources, custom (KQL)
    
    CACHING: 5min default, bypass_cache=true for fresh data
    
    EXAMPLES: 
    - Find VMs: custom_query = "Resources | where type == 'microsoft.compute/virtualmachines'"
    - Find by tag: custom_query = "Resources | where tags.env == 'prod'"`,
        inputSchema: {
            type: 'object',
            properties: {
                query_type: { type: 'string', enum: ['subscriptions', 'resource_groups', 'resources', 'custom'] },
                subscription_id: { type: 'string', description: 'Optional subscription scope' },
                resource_group: { type: 'string', description: 'Optional resource group filter' },
                custom_query: { type: 'string', description: 'KQL query for Resource Graph' },
                bypass_cache: { type: 'boolean', description: 'Force fresh data', default: false },
            },
            required: ['query_type'],
        },
    };
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It successfully describes important behavioral traits: the 5-minute default caching behavior and the bypass_cache parameter for fresh data. It also provides concrete examples of how to use custom queries. However, it doesn't mention authentication requirements, rate limits, or error conditions.

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 well-structured with clear sections (TYPES, CACHING, EXAMPLES) and front-loaded with the core purpose. Every sentence earns its place by providing essential information. The examples are specific and helpful without being verbose.

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?

For a tool with 5 parameters, 80% schema coverage, and no output schema, the description provides good contextual coverage. It explains the different query types, caching behavior, and provides practical examples. However, without annotations or output schema, it could benefit from mentioning what format the results return in or any authentication requirements.

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?

With 80% schema description coverage, the baseline would be 3, but the description adds significant value beyond the schema. The TYPES section clarifies what each query_type option returns, and the examples provide practical context for custom_query usage. The caching behavior explanation gives meaning to bypass_cache beyond the schema's 'Force fresh data' description.

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

Purpose4/5

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

The description clearly states the verb ('Retrieves') and resource ('Azure environment context'), making the purpose immediately understandable. It distinguishes itself from sibling tools like 'azure_service' and 'manage_azure_resources' by focusing on context retrieval rather than service operations or resource management. However, it doesn't explicitly contrast with siblings in the description text itself.

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

Usage Guidelines3/5

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

The description provides implied usage guidance through the TYPES section and examples, showing when to use different query types. However, it lacks explicit direction on when to choose this tool over alternatives like 'azure_service' or 'manage_azure_resources', and doesn't mention any prerequisites or exclusions for usage.

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/vedantparmar12/Azure-_MCP'

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