Skip to main content
Glama

list_categories

Retrieve available categories and AI tags to filter searches in the Spark marketplace catalog.

Instructions

List available categories (domains and AI tags) in the Spark marketplace. Useful for filtering searches.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration and handler for the list_categories tool. Fetches AI tags and domains from the Spark API taxonomy endpoints and formats them as a markdown response.
    server.tool(
      "list_categories",
      "List available categories (domains and AI tags) in the Spark marketplace. Useful for filtering searches.",
      {},
      async () => {
        const [ais, domains] = await Promise.all([
          sparkApi<AiTag[]>("/taxonomy/ais"),
          sparkApi<DomainGroup[]>("/taxonomy/domains"),
        ]);
    
        const sections: string[] = ["## AI Tags", ""];
        for (const tag of ais) {
          sections.push(`- ${tag.name} (\`${tag.slug}\`)`);
        }
    
        sections.push("", "## Domains", "");
        for (const group of domains) {
          sections.push(`### ${group.parent_name}`);
          for (const child of group.children) {
            sections.push(`- ${child.child_name} (\`${child.child_slug}\`)`);
          }
          sections.push("");
        }
    
        return {
          content: [{ type: "text" as const, text: sections.join("\n") }],
        };
      }
    );
  • Type definition for AI tag objects returned by the /taxonomy/ais API endpoint
    interface AiTag {
      slug: string;
      name: string;
    }
  • Type definition for domain group objects returned by the /taxonomy/domains API endpoint
    interface DomainGroup {
      parent_name: string;
      parent_slug: string;
      children: { child_name: string; child_slug: string }[];
    }
  • HTTP helper function used by list_categories handler to fetch data from the Spark API endpoints
    async function sparkApi<T = unknown>(path: string): Promise<T> {
      const url = `${SPARK_API}${path}`;
      const res = await fetch(url, {
        headers: { Accept: "application/json" },
      });
      if (!res.ok) {
        const text = await res.text().catch(() => res.statusText);
        throw new Error(`Spark API ${res.status}: ${text}`);
      }
      return res.json() as Promise<T>;
    }

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/entire-vc/evc-spark-mcp'

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