Skip to main content
Glama

browse-apis

Browse and filter APIs within a specific API group in Xano to manage endpoints and documentation.

Instructions

Browse APIs in a specific API group

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apigroup_idYesID of the API group to browse
pageNoPage number for pagination
per_pageNoNumber of items per page
searchNoSearch term to filter APIs
sortNoField to sort by
orderNoSort order

Implementation Reference

  • The main handler function for the 'browse-apis' tool. It fetches APIs from a specific API group in Xano using makeXanoRequest, formats them into markdown, and returns as text content.
    async ({ apigroup_id, page, per_page, search, sort, order }) => {
      console.error(`[Tool] Executing browse-apis for API group ID: ${apigroup_id}`);
      try {
        // Build query parameters
        const queryParams = new URLSearchParams();
        if (page !== undefined) queryParams.append("page", page.toString());
        if (per_page !== undefined) queryParams.append("per_page", per_page.toString());
        if (search) queryParams.append("search", search);
        if (sort) queryParams.append("sort", sort);
        if (order) queryParams.append("order", order);
        
        const queryString = queryParams.toString() ? `?${queryParams.toString()}` : '';
        
        const response = await makeXanoRequest<{ items: XanoApi[], curPage: number, nextPage?: number, prevPage?: number }>(
          `/workspace/${XANO_WORKSPACE}/apigroup/${apigroup_id}/api${queryString}`
        );
        
        const apis = response.items;
        
        // Format APIs into a readable structure
        const formattedContent = `# APIs in API Group ID: ${apigroup_id}\n\n` +
          `Page ${response.curPage}${response.nextPage ? ` (Next: ${response.nextPage})` : ''}${response.prevPage ? ` (Prev: ${response.prevPage})` : ''}\n\n` +
          `${apis.map(api =>
            `## ${api.name}\n` +
            `**ID**: ${api.id}\n` +
            `**Verb**: ${api.verb}\n` +
            `**Description**: ${api.description || 'No description'}\n` +
            `${api.docs ? `**Documentation**: ${api.docs}\n` : ''}` +
            `**Created**: ${new Date(api.created_at).toLocaleString()}\n` +
            `**Updated**: ${new Date(api.updated_at).toLocaleString()}\n` +
            `${api.guid ? `**GUID**: ${api.guid}\n` : ''}` +
            `${api.tag && api.tag.length > 0 ? `**Tags**: ${api.tag.join(', ')}\n` : ''}`
          ).join('\n\n')}`;
    
        console.error(`[Tool] Successfully listed ${apis.length} APIs for API group ID: ${apigroup_id}`);
        return {
          content: [
            {
              type: "text",
              text: formattedContent
            }
          ]
        };
      } catch (error) {
        console.error(`[Error] Failed to browse APIs: ${error instanceof Error ? error.message : String(error)}`);
        return {
          content: [
            {
              type: "text",
              text: `Error browsing APIs: ${error instanceof Error ? error.message : String(error)}`
            }
          ],
          isError: true
        };
      }
    }
  • Input schema for the 'browse-apis' tool using Zod validation, defining parameters like apigroup_id (required), and optional pagination, search, sort options.
    {
      apigroup_id: z.string().describe("ID of the API group to browse"),
      page: z.number().optional().describe("Page number for pagination"),
      per_page: z.number().optional().describe("Number of items per page"),
      search: z.string().optional().describe("Search term to filter APIs"),
      sort: z.enum(["created_at", "updated_at", "name"]).optional().describe("Field to sort by"),
      order: z.enum(["asc", "desc"]).optional().describe("Sort order")
    },
  • src/index.ts:852-919 (registration)
    Registration of the 'browse-apis' tool on the MCP server using server.tool(), specifying name, description, input schema, and handler function.
    server.tool(
      "browse-apis",
      "Browse APIs in a specific API group",
      {
        apigroup_id: z.string().describe("ID of the API group to browse"),
        page: z.number().optional().describe("Page number for pagination"),
        per_page: z.number().optional().describe("Number of items per page"),
        search: z.string().optional().describe("Search term to filter APIs"),
        sort: z.enum(["created_at", "updated_at", "name"]).optional().describe("Field to sort by"),
        order: z.enum(["asc", "desc"]).optional().describe("Sort order")
      },
      async ({ apigroup_id, page, per_page, search, sort, order }) => {
        console.error(`[Tool] Executing browse-apis for API group ID: ${apigroup_id}`);
        try {
          // Build query parameters
          const queryParams = new URLSearchParams();
          if (page !== undefined) queryParams.append("page", page.toString());
          if (per_page !== undefined) queryParams.append("per_page", per_page.toString());
          if (search) queryParams.append("search", search);
          if (sort) queryParams.append("sort", sort);
          if (order) queryParams.append("order", order);
          
          const queryString = queryParams.toString() ? `?${queryParams.toString()}` : '';
          
          const response = await makeXanoRequest<{ items: XanoApi[], curPage: number, nextPage?: number, prevPage?: number }>(
            `/workspace/${XANO_WORKSPACE}/apigroup/${apigroup_id}/api${queryString}`
          );
          
          const apis = response.items;
          
          // Format APIs into a readable structure
          const formattedContent = `# APIs in API Group ID: ${apigroup_id}\n\n` +
            `Page ${response.curPage}${response.nextPage ? ` (Next: ${response.nextPage})` : ''}${response.prevPage ? ` (Prev: ${response.prevPage})` : ''}\n\n` +
            `${apis.map(api =>
              `## ${api.name}\n` +
              `**ID**: ${api.id}\n` +
              `**Verb**: ${api.verb}\n` +
              `**Description**: ${api.description || 'No description'}\n` +
              `${api.docs ? `**Documentation**: ${api.docs}\n` : ''}` +
              `**Created**: ${new Date(api.created_at).toLocaleString()}\n` +
              `**Updated**: ${new Date(api.updated_at).toLocaleString()}\n` +
              `${api.guid ? `**GUID**: ${api.guid}\n` : ''}` +
              `${api.tag && api.tag.length > 0 ? `**Tags**: ${api.tag.join(', ')}\n` : ''}`
            ).join('\n\n')}`;
    
          console.error(`[Tool] Successfully listed ${apis.length} APIs for API group ID: ${apigroup_id}`);
          return {
            content: [
              {
                type: "text",
                text: formattedContent
              }
            ]
          };
        } catch (error) {
          console.error(`[Error] Failed to browse APIs: ${error instanceof Error ? error.message : String(error)}`);
          return {
            content: [
              {
                type: "text",
                text: `Error browsing APIs: ${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 mentions browsing APIs but doesn't specify whether this is a read-only operation, if it requires authentication, what the output format looks like, or any rate limits. This leaves significant gaps for an agent to understand the tool's behavior.

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 unnecessary words. It's appropriately sized and front-loaded, making it easy to understand at a glance.

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?

Given the complexity of 6 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain the return values, error conditions, or behavioral traits, leaving the agent with incomplete information to use the tool effectively.

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 input schema has 100% description coverage, so all parameters are documented in the schema. The description doesn't add any additional meaning beyond what's in the schema, such as explaining how pagination works or what the search term filters. This meets 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 verb ('browse') and resource ('APIs in a specific API group'), making the purpose evident. However, it doesn't distinguish this tool from sibling tools like 'list-api-groups' or 'get-api-spec', which could cause confusion about when to use each.

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?

No guidance is provided on when to use this tool versus alternatives like 'list-api-groups' or 'get-api-spec'. The description only states what it does without context about prerequisites, exclusions, or comparisons to sibling tools.

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