Skip to main content
Glama

create-api-group

Create and configure a new API group in a Xano workspace, including enabling Swagger documentation, adding tags, and specifying a branch for organization.

Instructions

Create a new API group in the Xano workspace

Input Schema

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

Implementation Reference

  • The handler function that implements the create-api-group tool logic. 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 API group, then formats a success response.
    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 schema defining the input parameters for the create-api-group tool, including name, description, swagger flag, optional docs, tags, and branch.
    { 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)
    The server.tool registration call that registers the create-api-group tool with its 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 }; } } );

Other Tools

Related 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