Skip to main content
Glama
vedantparmar12

Azure Omni-Tool MCP Server

manage_azure_resources

Execute Azure CLI commands with safety controls, including plan/review workflows, command validation, and audit logging for operations across Azure services.

Instructions

Primary tool for all Azure operations via CLI.

FLOW: 1) Call with execute_now=false for plan 2) Review risk 3) Call with execute_now=true to execute

SAFETY: Commands validated for injection. Destructive ops flagged HIGH risk.

AUDIT: All ops logged with operator email and correlation ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYesAzure CLI command (e.g., "az aks create ...")
explanationYesWhy this command was chosen
execute_nowNofalse: plan only, true: execute

Implementation Reference

  • The core handler function that sanitizes input, assesses risk, plans or executes Azure CLI commands, handles auditing, logging, error analysis, and returns structured responses for planning or execution.
    export async function handleManageAzureResources(
        input: ManageAzureResourcesInput
    ): Promise<PlanResponse | ExecutionResponse> {
        const { command, explanation, execute_now } = input;
        const operator = getOperatorInfo();
    
        const validation = sanitizeInput(command);
    
        if (!validation.isValid) {
            logger.warn('Command validation failed', { command, error: validation.error });
            return {
                proposed_command: command,
                risk_level: 'high',
                summary: 'Validation failed',
                explanation,
                status: 'REJECTED',
                warnings: [validation.error || 'Unknown error'],
                next_steps: 'Provide a valid Azure CLI command.',
                operator,
            };
        }
    
        const cmd = validation.sanitizedCommand!;
        const risk = validation.riskLevel;
        const audit = createAuditContext(cmd, risk, execute_now ? 'execute' : 'plan');
    
        if (!execute_now) {
            const summary = generateCommandSummary(cmd);
            const nextSteps = risk === 'high'
                ? '⚠️ HIGH RISK: Review carefully before execute_now=true'
                : 'Call again with execute_now=true to execute.';
    
            logger.command('plan', cmd, 'success', { riskLevel: risk, correlationId: audit.correlationId });
    
            return {
                proposed_command: cmd,
                risk_level: risk,
                summary,
                explanation,
                status: 'WAITING_FOR_CONFIRMATION',
                warnings: validation.warnings,
                next_steps: nextSteps,
                correlation_id: audit.correlationId,
                operator,
            };
        }
    
        logger.info('Executing', { command: cmd, correlationId: audit.correlationId });
    
        const result: CommandResult = await executeAzCommand(cmd, { applyScope: true, enableRetry: true });
    
        if (result.success) {
            await audit.logSuccess();
            logger.command('execute', cmd, 'success', { correlationId: audit.correlationId });
    
            return {
                executed_command: cmd,
                status: 'EXECUTED',
                success: true,
                output: result.parsedOutput ?? result.stdout,
                raw_output: result.stdout,
                correlation_id: audit.correlationId,
                operator,
            };
        }
    
        const analysis = analyzeError(result.stderr);
        await audit.logFailure(result.stderr);
        logger.command('execute', cmd, 'failure', { correlationId: audit.correlationId, error: result.stderr });
    
        return {
            executed_command: cmd,
            status: 'FAILED',
            success: false,
            error: result.stderr || 'Execution failed',
            stderr: result.stderr,
            error_analysis: analysis,
            correlation_id: audit.correlationId,
            operator,
        };
    }
  • Zod schema defining the input structure for the manage_azure_resources tool, including command, explanation, and execute_now flag.
    export const ManageAzureResourcesSchema = z.object({
        command: z.string().describe('Azure CLI command to execute'),
        explanation: z.string().describe('Why this command was chosen'),
        execute_now: z.boolean().default(false).describe('If true, execute; if false, plan only'),
    });
  • src/index.ts:23-27 (registration)
    Tool registration in the MCP server registry, mapping the tool name to its metadata, schema, and handler wrapper.
    ['manage_azure_resources', {
        tool: manageAzureResourcesTool,
        schema: ManageAzureResourcesSchema,
        handler: args => handleManageAzureResources(ManageAzureResourcesSchema.parse(args))
    }],
  • Tool metadata object with name, description, and input schema for MCP protocol compliance.
    export const manageAzureResourcesTool = {
        name: 'manage_azure_resources',
        description: `Primary tool for all Azure operations via CLI.
    
    FLOW: 1) Call with execute_now=false for plan 2) Review risk 3) Call with execute_now=true to execute
    
    SAFETY: Commands validated for injection. Destructive ops flagged HIGH risk.
    
    AUDIT: All ops logged with operator email and correlation ID.`,
        inputSchema: {
            type: 'object',
            properties: {
                command: { type: 'string', description: 'Azure CLI command (e.g., "az aks create ...")' },
                explanation: { type: 'string', description: 'Why this command was chosen' },
                execute_now: { type: 'boolean', description: 'false: plan only, true: execute', default: false },
            },
            required: ['command', 'explanation'],
        },
    };
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 and does well by disclosing key behavioral traits: it mentions safety ('Commands validated for injection. Destructive ops flagged HIGH risk.') and audit logging ('All ops logged with operator email and correlation ID.'). However, it lacks details on rate limits, error handling, or response formats, which would enhance transparency further.

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 highly concise and well-structured, using clear sections (FLOW, SAFETY, AUDIT) with bullet-like formatting. Every sentence adds critical information without redundancy, making it easy to scan and understand quickly.

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?

Given the tool's complexity (executing Azure CLI commands with safety and audit considerations) and no output schema, the description is fairly complete: it covers usage flow, safety, and logging. However, it lacks details on output format, error cases, or prerequisites, which would be helpful for a tool with no annotations or output schema.

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%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema by implying the purpose of 'execute_now' in the flow, but it doesn't provide additional semantic context for 'command' or 'explanation' that isn't already in the schema descriptions.

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 this is the 'Primary tool for all Azure operations via CLI,' which establishes it as the main interface for executing Azure commands. However, it doesn't explicitly differentiate from sibling tools like 'azure_service' or 'get_azure_context'—it implies but doesn't state that this is for command execution while others might be for service management or context retrieval.

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?

The description provides explicit usage guidance with a step-by-step flow: '1) Call with execute_now=false for plan 2) Review risk 3) Call with execute_now=true to execute.' This clearly indicates when to use the tool (for planning vs. execution) and implies alternatives by referencing risk review, though it doesn't name specific sibling tools as alternatives.

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