Skip to main content
Glama

create-api-group

Create a new API group in Xano workspace to organize endpoints, configure documentation, and manage API structure.

Instructions

Create a new API group in the Xano workspace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the API group
descriptionYesDescription of the API group
swaggerYesWhether to enable Swagger documentation
docsNoDocumentation for the API group
tagNoTags to associate with the API group
branchNoBranch name for the API group

Implementation Reference

  • The handler function for the 'create-api-group' tool. It constructs a request body from the input parameters and makes a POST request to the Xano API endpoint `/workspace/${XANO_WORKSPACE}/apigroup` to create the new API group. It then formats a success response with details about the created group.
    async ({ name, description, swagger, docs, tag, branch }) => {
      console.error(`[Tool] Executing create-api-group for name: ${name}`);
      try {
        const requestBody = {
          name,
          description,
          swagger,
          ...(docs !== undefined && { docs }),
          ...(tag !== undefined && { tag }),
          ...(branch !== undefined && { branch })
        };
        
        const response = await makeXanoRequest<XanoApiGroup>(
          `/workspace/${XANO_WORKSPACE}/apigroup`,
          'POST',
          requestBody
        );
        
        console.error(`[Tool] Successfully created API group "${name}" with ID: ${response.id}`);
        
        const formattedContent = `# API Group Created\n\n` +
          `**Name**: ${response.name}\n` +
          `**ID**: ${response.id}\n` +
          `**Description**: ${response.description || 'No description'}\n` +
          `${response.docs ? `**Documentation**: ${response.docs}\n` : ''}` +
          `**Swagger Documentation**: ${response.swagger ? 'Enabled' : 'Disabled'}\n` +
          `**Created**: ${new Date(response.created_at).toLocaleString()}\n` +
          `**Updated**: ${new Date(response.updated_at).toLocaleString()}\n` +
          `${response.guid ? `**GUID**: ${response.guid}\n` : ''}` +
          `${response.canonical ? `**Canonical**: ${response.canonical}\n` : ''}` +
          `${response.branch ? `**Branch**: ${response.branch}\n` : ''}` +
          `${response.tag && response.tag.length > 0 ? `**Tags**: ${response.tag.join(', ')}\n` : ''}`;
        
        return {
          content: [
            {
              type: "text",
              text: formattedContent
            }
          ]
        };
      } catch (error) {
        console.error(`[Error] Failed to create API group: ${error instanceof Error ? error.message : String(error)}`);
        return {
          content: [
            {
              type: "text",
              text: `Error creating API group: ${error instanceof Error ? error.message : String(error)}`
            }
          ],
          isError: true
        };
      }
    }
  • Zod input schema defining the parameters for the 'create-api-group' tool: name (required string), description (required string), swagger (boolean), docs (optional string), tag (optional nullable array of strings), branch (optional string).
    {
      name: z.string().describe("Name of the API group"),
      description: z.string().describe("Description of the API group"),
      swagger: z.boolean().describe("Whether to enable Swagger documentation"),
      docs: z.string().optional().describe("Documentation for the API group"),
      tag: z.array(z.string()).optional().nullable().describe("Tags to associate with the API group"),
      branch: z.string().optional().describe("Branch name for the API group")
    },
  • src/index.ts:718-783 (registration)
    Registration of the 'create-api-group' tool using the MCP server's 'tool' method, including name, description, input schema, and handler function.
    server.tool(
      "create-api-group",
      "Create a new API group in the Xano workspace",
      {
        name: z.string().describe("Name of the API group"),
        description: z.string().describe("Description of the API group"),
        swagger: z.boolean().describe("Whether to enable Swagger documentation"),
        docs: z.string().optional().describe("Documentation for the API group"),
        tag: z.array(z.string()).optional().nullable().describe("Tags to associate with the API group"),
        branch: z.string().optional().describe("Branch name for the API group")
      },
      async ({ name, description, swagger, docs, tag, branch }) => {
        console.error(`[Tool] Executing create-api-group for name: ${name}`);
        try {
          const requestBody = {
            name,
            description,
            swagger,
            ...(docs !== undefined && { docs }),
            ...(tag !== undefined && { tag }),
            ...(branch !== undefined && { branch })
          };
          
          const response = await makeXanoRequest<XanoApiGroup>(
            `/workspace/${XANO_WORKSPACE}/apigroup`,
            'POST',
            requestBody
          );
          
          console.error(`[Tool] Successfully created API group "${name}" with ID: ${response.id}`);
          
          const formattedContent = `# API Group Created\n\n` +
            `**Name**: ${response.name}\n` +
            `**ID**: ${response.id}\n` +
            `**Description**: ${response.description || 'No description'}\n` +
            `${response.docs ? `**Documentation**: ${response.docs}\n` : ''}` +
            `**Swagger Documentation**: ${response.swagger ? 'Enabled' : 'Disabled'}\n` +
            `**Created**: ${new Date(response.created_at).toLocaleString()}\n` +
            `**Updated**: ${new Date(response.updated_at).toLocaleString()}\n` +
            `${response.guid ? `**GUID**: ${response.guid}\n` : ''}` +
            `${response.canonical ? `**Canonical**: ${response.canonical}\n` : ''}` +
            `${response.branch ? `**Branch**: ${response.branch}\n` : ''}` +
            `${response.tag && response.tag.length > 0 ? `**Tags**: ${response.tag.join(', ')}\n` : ''}`;
          
          return {
            content: [
              {
                type: "text",
                text: formattedContent
              }
            ]
          };
        } catch (error) {
          console.error(`[Error] Failed to create API group: ${error instanceof Error ? error.message : String(error)}`);
          return {
            content: [
              {
                type: "text",
                text: `Error creating API group: ${error instanceof Error ? error.message : String(error)}`
              }
            ],
            isError: true
          };
        }
      }
    );
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. It states the tool creates something, implying a write operation, but doesn't cover critical aspects like authentication requirements, rate limits, error handling, or whether the creation is irreversible. 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, efficient sentence that directly states the tool's purpose without any fluff or redundancy. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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 address behavioral traits like side effects, response format, or error conditions, leaving the agent with incomplete context to use the tool effectively in complex scenarios.

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?

The schema description coverage is 100%, so the schema already documents all 6 parameters thoroughly. The description adds no additional meaning beyond the schema, such as explaining parameter interactions or default behaviors, but doesn't need to compensate for gaps, resulting in a baseline score.

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 ('new API group in the Xano workspace'), making the purpose unambiguous. However, it doesn't differentiate from sibling tools like 'add-api' or 'list-api-groups', which would require explicit comparison to achieve a perfect score.

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 like 'add-api' or 'browse-apis'. It lacks context about prerequisites, such as workspace permissions or whether this is for initial setup versus ongoing management, leaving the agent with minimal usage direction.

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/lowcodelocky2/xano-mcp'

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