Skip to main content
Glama

idea.expand

Read-only

Generate keyword scaffolding for any product idea, including core keywords, adjacent niches, pain points, competitor names, and exclusion terms. No search execution required. Use to plan manual outreach copy.

Instructions

Generate the keyword scaffolding (core keywords, adjacent niches, pain points, competitor names, exclusion terms) for a product idea, without running searches. Behavior: hits the same theme-expansion endpoint leads.find calls internally as its first step. Consumes one credit. Stateless; nothing persists. Usage: call this when the user wants to see the search scaffolding before committing to a full run, or when planning manual outreach copy and you want the buyer-language vocabulary. Do NOT use this as a precursor to leads.find in the same session, leads.find runs theme expansion itself; calling both is double-billing. Returns: { core_keywords, adjacent_niches, pain_points, competitor_names, exclusion_terms } as string arrays.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ideaYesThe app idea to expand into search themes

Implementation Reference

  • The handler function for the 'idea.expand' tool. Makes POST to 'theme-expansion' endpoint, formats the returned ThemeExpansion fields into a text response.
    server.tool(
      "idea.expand",
      "Generate the keyword scaffolding (core keywords, adjacent niches, pain points, competitor names, exclusion terms) for a product idea, without running searches. Behavior: hits the same theme-expansion endpoint leads.find calls internally as its first step. Consumes one credit. Stateless; nothing persists. Usage: call this when the user wants to see the search scaffolding before committing to a full run, or when planning manual outreach copy and you want the buyer-language vocabulary. Do NOT use this as a precursor to leads.find in the same session, leads.find runs theme expansion itself; calling both is double-billing. Returns: { core_keywords, adjacent_niches, pain_points, competitor_names, exclusion_terms } as string arrays.",
      {
        idea: z.string().describe("The app idea to expand into search themes"),
      },
      {
        title: "Expand themes",
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: false,
        openWorldHint: true,
      },
      async ({ idea }) => {
        const err = requireKey();
        if (err) return err;
    
        const { expansion } = await call<{ expansion: ThemeExpansion }>(
          "POST",
          "theme-expansion",
          { idea }
        );
    
        const sections = [
          `Keywords: ${expansion.core_keywords.join(", ")}`,
          `Niches: ${expansion.adjacent_niches.join(", ")}`,
          `Pain points: ${expansion.pain_points.join(", ")}`,
          `Competitors: ${expansion.competitor_names.join(", ")}`,
          `Exclusions: ${expansion.exclusion_terms.join(", ")}`,
        ].join("\n");
    
        return {
          content: [
            {
              type: "text" as const,
              text: `Theme expansion for "${idea}":\n\n${sections}\n\nUse these to build queries for leads.search.`,
            },
          ],
        };
      }
    );
  • The ThemeExpansion interface defining the shape of the response: core_keywords, adjacent_niches, pain_points, competitor_names, exclusion_terms (all string arrays).
    interface ThemeExpansion {
      core_keywords: string[];
      adjacent_niches: string[];
      pain_points: string[];
      competitor_names: string[];
      exclusion_terms: string[];
    }
  • src/index.ts:467-507 (registration)
    Registration of the tool with name 'idea.expand' via server.tool(), including its description and input schema.
    server.tool(
      "idea.expand",
      "Generate the keyword scaffolding (core keywords, adjacent niches, pain points, competitor names, exclusion terms) for a product idea, without running searches. Behavior: hits the same theme-expansion endpoint leads.find calls internally as its first step. Consumes one credit. Stateless; nothing persists. Usage: call this when the user wants to see the search scaffolding before committing to a full run, or when planning manual outreach copy and you want the buyer-language vocabulary. Do NOT use this as a precursor to leads.find in the same session, leads.find runs theme expansion itself; calling both is double-billing. Returns: { core_keywords, adjacent_niches, pain_points, competitor_names, exclusion_terms } as string arrays.",
      {
        idea: z.string().describe("The app idea to expand into search themes"),
      },
      {
        title: "Expand themes",
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: false,
        openWorldHint: true,
      },
      async ({ idea }) => {
        const err = requireKey();
        if (err) return err;
    
        const { expansion } = await call<{ expansion: ThemeExpansion }>(
          "POST",
          "theme-expansion",
          { idea }
        );
    
        const sections = [
          `Keywords: ${expansion.core_keywords.join(", ")}`,
          `Niches: ${expansion.adjacent_niches.join(", ")}`,
          `Pain points: ${expansion.pain_points.join(", ")}`,
          `Competitors: ${expansion.competitor_names.join(", ")}`,
          `Exclusions: ${expansion.exclusion_terms.join(", ")}`,
        ].join("\n");
    
        return {
          content: [
            {
              type: "text" as const,
              text: `Theme expansion for "${idea}":\n\n${sections}\n\nUse these to build queries for leads.search.`,
            },
          ],
        };
      }
    );
  • The requireKey helper used by the handler to check for a valid GORILLA_API_KEY before proceeding.
    function requireKey() {
      if (!GORILLA_API_KEY) {
        return {
          content: [
            {
              type: "text" as const,
              text: "GORILLA_API_KEY is not set. Sign up at https://usegorilla.app, then create a key at gorilla.opusforge.com.br > Menu > API Keys and set GORILLA_API_KEY in your environment.",
            },
          ],
        };
      }
      return null;
    }
  • The call<T> HTTP helper used by the handler to POST to the 'theme-expansion' API endpoint.
    async function call<T>(
      method: "GET" | "POST" | "DELETE",
      endpoint: string,
      body?: unknown
    ): Promise<T> {
      const cfg = await getConfig();
      const res = await fetch(`${cfg.api_base}/${endpoint}`, {
        method,
        headers: {
          "Content-Type": "application/json",
          "x-api-key": GORILLA_API_KEY,
          apikey: cfg.gateway_key,
        },
        ...(body !== undefined ? { body: JSON.stringify(body) } : {}),
      });
    
      if (!res.ok) {
        const text = await res.text().catch(() => "");
        throw new Error(`${method} /${endpoint} failed (${res.status}): ${text}`);
      }
    
      return res.json() as Promise<T>;
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true. Description adds key behaviors: 'Consumes one credit,' 'Stateless; nothing persists,' and that it uses the same endpoint as leads.find. This goes beyond the annotations to explain side effects and internal mechanics, but does not cover all potential edge cases.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (Behavior, Usage, Returns). It is somewhat lengthy but every sentence adds value, including the warning about double-billing. However, it could be slightly more concise by removing minor redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with one parameter and no output schema, the description covers everything: purpose, behavior, usage, return structure, and important caveats (credit consumption, statelessness, double-billing risk). No gaps remain for effective agent usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with a clear description for 'idea'. The description adds context by framing the parameter as a 'product idea' and specifying the output categories (core keywords, etc.), which helps the agent understand the transformation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

'Generate the keyword scaffolding... for a product idea, without running searches' clearly states the action and output. It distinguishes from sibling leads.find by noting that leads.find runs theme expansion itself, thus avoiding conflating the two.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use: 'when the user wants to see the search scaffolding before committing to a full run, or when planning manual outreach copy.' It also gives an explicit when-not: 'Do NOT use this as a precursor to leads.find... calling both is double-billing.' This provides clear alternatives.

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/opusforge/gorilla-mcp'

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