Skip to main content
Glama

create-resource-group

Create a new Azure resource group to organize and manage cloud resources by specifying name, location, and optional tags.

Instructions

Create a new resource group

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesResource group name
locationYesAzure region
tagsNoResource tags (optional)

Implementation Reference

  • Core handler function in AzureOperations class that performs the actual resource group creation using Azure ResourceManagementClient's createOrUpdate method.
    async createResourceGroup(
      name: string,
      location: string,
      tags?: Record<string, string>
    ) {
      if (!this.context.resourceClient) {
        throw new AzureMCPError("Client not initialized", "NO_CLIENT");
      }
    
      return await this.context.resourceClient.resourceGroups.createOrUpdate(
        name,
        { location, tags }
      );
    }
  • Primary MCP tool handler method that validates input arguments using Zod, delegates to AzureOperations.createResourceGroup, invalidates cache, and formats the response.
    private async handleCreateResourceGroup(args: any) {
      const { name, location, tags } = z
        .object({
          name: z.string().min(1, "Resource group name cannot be empty"),
          location: z.string().min(1, "Location cannot be empty"),
          tags: z.record(z.string()).optional(),
        })
        .parse(args);
    
      if (!this.context.resourceClient) {
        throw new AzureMCPError("Client not initialized", "NO_CLIENT");
      }
    
      try {
        // Use azureOperations to create the resource group
        const result = await this.azureOperations.createResourceGroup(
          name,
          location,
          tags
        );
    
        // Invalidate cache for resource groups list
        this.resourceCache.delete(
          `resource-groups-${this.context.selectedSubscription}`
        );
    
        return {
          id: result.id,
          name: result.name,
          location: result.location,
          tags: result.tags || {},
          provisioningState: result.properties?.provisioningState,
        };
      } catch (error) {
        this.logWithContext("error", `Error creating resource group: ${error}`, {
          error,
        });
        throw new AzureResourceError(`Failed to create resource group: ${error}`);
      }
    }
  • Tool registration in handleListTools method, defining the tool name, description, and input schema for MCP protocol.
    {
      name: "create-resource-group",
      description: "Create a new resource group",
      inputSchema: {
        type: "object",
        properties: {
          name: {
            type: "string",
            description: "Resource group name",
          },
          location: {
            type: "string",
            description: "Azure region",
          },
          tags: {
            type: "object",
            description: "Resource tags (optional)",
          },
        },
        required: ["name", "location"],
      },
    },
  • Switch case in handleCallTool that dispatches calls to the specific handler for 'create-resource-group' tool.
    case "create-resource-group":
      result = await this.handleCreateResourceGroup(args);
      break;
  • Zod schema validation for input arguments in the handler function, providing additional runtime type checking.
    const { name, location, tags } = z
      .object({
        name: z.string().min(1, "Resource group name cannot be empty"),
        location: z.string().min(1, "Location cannot be empty"),
        tags: z.record(z.string()).optional(),
      })
      .parse(args);
Behavior2/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. 'Create a new resource group' implies a write/mutation operation, but it doesn't address permissions required, whether this is idempotent, what happens on conflicts, rate limits, or what the response contains. This leaves significant gaps for a mutation tool.

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, clear sentence with zero wasted words. It's appropriately sized for a simple creation operation and front-loads the essential information.

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?

For a mutation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after creation, error conditions, or behavioral aspects. Given the complexity (creating Azure resources) and lack of structured data, more context is needed.

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 (name, location, tags) with their types and descriptions. The description adds no additional parameter information beyond what's in the schema, meeting the baseline for high schema coverage.

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 action ('Create') and resource ('resource group'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its siblings like 'list-resource-groups' or 'get-resource-details' beyond the obvious creation vs. listing distinction.

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 prerequisites, dependencies, or scenarios where this creation operation is appropriate versus other tools in the sibling list.

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/kalivaraprasad-gonapa/azure-mcp'

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