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 }; } } );

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