Skip to main content
Glama

idea.refine

Read-only

Refine a SaaS idea through guided Q&A rounds, each turn returning a refined idea with readiness score and audience model until a threshold of 75 is reached, preparing the idea for lead search.

Instructions

Run one round of conversational refinement on a SaaS idea before searching for leads. Behavior: hits the same /refine endpoint the usegorilla.app site uses. Stateless on the server side; the MCP caller must carry history across turns. Does not write any DB rows and does NOT consume a credit. Idempotent. Usage: call this on the first turn with just {idea}, ask the returned question to the user, then call again with the same idea, the previous refined_idea as current_refined_idea, and the new {question, answer} appended to history. Stop when status is 'ready' (readiness_score crosses ~75) or after max_turns. Do NOT call idea.refine after leads.find has already run, the refinement is a pre-search step. Returns: status (ready or needs_answer), refined_idea (full text), readiness_score (0-100) with reason, missing_info list, audience_model, and one next question with suggested options (or null if ready).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ideaYesThe original raw idea text. Stays the same across turns.
current_refined_ideaNoThe latest refined_idea returned by a previous idea.refine call. Omit on the first turn.
historyNoPrior turns: each entry is the question the server asked and the user's answer. Empty / omitted on the first turn.
languageNoOutput language. 'all' (default) auto-detects from the idea text.
turnNo1-based turn number. Lets the server stop sooner if needed.
max_turnsNoMaximum rounds before the server forces status='ready'. Default 5.

Implementation Reference

  • src/index.ts:298-393 (registration)
    Registration of the 'idea.refine' tool on the MCP server with its description, schema, and metadata.
    server.tool(
      "idea.refine",
      "Run one round of conversational refinement on a SaaS idea before searching for leads. Behavior: hits the same /refine endpoint the usegorilla.app site uses. Stateless on the server side; the MCP caller must carry history across turns. Does not write any DB rows and does NOT consume a credit. Idempotent. Usage: call this on the first turn with just {idea}, ask the returned question to the user, then call again with the same idea, the previous refined_idea as current_refined_idea, and the new {question, answer} appended to history. Stop when status is 'ready' (readiness_score crosses ~75) or after max_turns. Do NOT call idea.refine after leads.find has already run, the refinement is a pre-search step. Returns: status (ready or needs_answer), refined_idea (full text), readiness_score (0-100) with reason, missing_info list, audience_model, and one next question with suggested options (or null if ready).",
      {
        idea: z.string().describe("The original raw idea text. Stays the same across turns."),
        current_refined_idea: z
          .string()
          .optional()
          .describe("The latest refined_idea returned by a previous idea.refine call. Omit on the first turn."),
        history: z
          .array(
            z.object({
              question: z.string(),
              answer: z.string(),
            }),
          )
          .optional()
          .describe("Prior turns: each entry is the question the server asked and the user's answer. Empty / omitted on the first turn."),
        language: z
          .enum(["en", "pt", "all"])
          .optional()
          .describe("Output language. 'all' (default) auto-detects from the idea text."),
        turn: z
          .number()
          .int()
          .optional()
          .describe("1-based turn number. Lets the server stop sooner if needed."),
        max_turns: z
          .number()
          .int()
          .optional()
          .describe("Maximum rounds before the server forces status='ready'. Default 5."),
      },
      {
        title: "Refine idea",
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: false,
        openWorldHint: true,
      },
      async ({ idea, current_refined_idea, history, language, turn, max_turns }) => {
        const err = requireKey();
        if (err) return err;
    
        const body: Record<string, unknown> = { idea };
        if (current_refined_idea) body.current_refined_idea = current_refined_idea;
        if (history && history.length) body.history = history;
        const effectiveLanguage =
          language ??
          (GORILLA_DEFAULT_LANGUAGE === "en" ||
          GORILLA_DEFAULT_LANGUAGE === "pt" ||
          GORILLA_DEFAULT_LANGUAGE === "all"
            ? GORILLA_DEFAULT_LANGUAGE
            : undefined);
        if (effectiveLanguage) body.language = effectiveLanguage;
        if (typeof turn === "number") body.turn = turn;
        if (typeof max_turns === "number") body.max_turns = max_turns;
    
        const r = await call<{
          status: "ready" | "needs_answer";
          refined_idea: string;
          readiness_score: number;
          readiness_reason: string;
          missing_info: string[];
          audience_model: unknown;
          question: { question: string; options?: string[] } | null;
        }>("POST", "refine", body);
    
        const lines: string[] = [];
        lines.push(`Status: ${r.status} (readiness ${r.readiness_score}/100)`);
        lines.push("");
        lines.push(`Refined idea:\n  ${r.refined_idea}`);
        if (r.missing_info.length) {
          lines.push("");
          lines.push(`Still missing: ${r.missing_info.join("; ")}`);
        }
        if (r.status === "needs_answer" && r.question) {
          lines.push("");
          lines.push(`Next question: ${r.question.question}`);
          if (r.question.options && r.question.options.length) {
            lines.push(`Suggested answers: ${r.question.options.join(" | ")}`);
          }
          lines.push("");
          lines.push(
            "Call idea.refine again with the same `idea`, this question's `refined_idea` as `current_refined_idea`, and a `history` array including {question, answer}.",
          );
        } else {
          lines.push("");
          lines.push("Idea is ready. Pass `refined_idea` to leads.find.");
        }
    
        return {
          content: [{ type: "text" as const, text: lines.join("\n") }],
        };
      },
    );
  • Input schema for idea.refine: idea (required), current_refined_idea, history (array of {question, answer}), language (enum en/pt/all), turn, and max_turns.
    {
      idea: z.string().describe("The original raw idea text. Stays the same across turns."),
      current_refined_idea: z
        .string()
        .optional()
        .describe("The latest refined_idea returned by a previous idea.refine call. Omit on the first turn."),
      history: z
        .array(
          z.object({
            question: z.string(),
            answer: z.string(),
          }),
        )
        .optional()
        .describe("Prior turns: each entry is the question the server asked and the user's answer. Empty / omitted on the first turn."),
      language: z
        .enum(["en", "pt", "all"])
        .optional()
        .describe("Output language. 'all' (default) auto-detects from the idea text."),
      turn: z
        .number()
        .int()
        .optional()
        .describe("1-based turn number. Lets the server stop sooner if needed."),
      max_turns: z
        .number()
        .int()
        .optional()
        .describe("Maximum rounds before the server forces status='ready'. Default 5."),
    },
  • Handler function for idea.refine: builds request body, calls POST /refine endpoint, formats and returns the response including status, readiness score, refined idea, missing info, and next question.
      async ({ idea, current_refined_idea, history, language, turn, max_turns }) => {
        const err = requireKey();
        if (err) return err;
    
        const body: Record<string, unknown> = { idea };
        if (current_refined_idea) body.current_refined_idea = current_refined_idea;
        if (history && history.length) body.history = history;
        const effectiveLanguage =
          language ??
          (GORILLA_DEFAULT_LANGUAGE === "en" ||
          GORILLA_DEFAULT_LANGUAGE === "pt" ||
          GORILLA_DEFAULT_LANGUAGE === "all"
            ? GORILLA_DEFAULT_LANGUAGE
            : undefined);
        if (effectiveLanguage) body.language = effectiveLanguage;
        if (typeof turn === "number") body.turn = turn;
        if (typeof max_turns === "number") body.max_turns = max_turns;
    
        const r = await call<{
          status: "ready" | "needs_answer";
          refined_idea: string;
          readiness_score: number;
          readiness_reason: string;
          missing_info: string[];
          audience_model: unknown;
          question: { question: string; options?: string[] } | null;
        }>("POST", "refine", body);
    
        const lines: string[] = [];
        lines.push(`Status: ${r.status} (readiness ${r.readiness_score}/100)`);
        lines.push("");
        lines.push(`Refined idea:\n  ${r.refined_idea}`);
        if (r.missing_info.length) {
          lines.push("");
          lines.push(`Still missing: ${r.missing_info.join("; ")}`);
        }
        if (r.status === "needs_answer" && r.question) {
          lines.push("");
          lines.push(`Next question: ${r.question.question}`);
          if (r.question.options && r.question.options.length) {
            lines.push(`Suggested answers: ${r.question.options.join(" | ")}`);
          }
          lines.push("");
          lines.push(
            "Call idea.refine again with the same `idea`, this question's `refined_idea` as `current_refined_idea`, and a `history` array including {question, answer}.",
          );
        } else {
          lines.push("");
          lines.push("Idea is ready. Pass `refined_idea` to leads.find.");
        }
    
        return {
          content: [{ type: "text" as const, text: lines.join("\n") }],
        };
      },
    );
Behavior1/5

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

The description claims the tool is idempotent, but annotations set idempotentHint=false, creating a direct contradiction. While the description adds useful behavioral details (stateless, no DB writes, no credit consumption), the contradiction undermines transparency and could mislead the agent.

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 dense but well-organized: purpose first, then behavioral notes, usage instructions, and return fields. Every sentence adds value; there is no redundancy or fluff. It is concise for the complexity involved.

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?

Given the tool's complexity (multi-turn conversational refinement) and no output schema, the description fully explains the return structure (status, refined_idea, readiness_score, etc.) and the stopping condition (score ~75 or max_turns). It is self-contained and complete.

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%, so baseline is 3. The description adds context beyond schema descriptions, such as that 'idea' stays the same across turns, 'current_refined_idea' should be omitted on first turn, and 'history' is appended each turn. This enriches the meaning for the agent.

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?

The description clearly states the tool refines a SaaS idea conversationally, with a specific verb ('refine') and resource ('SaaS idea'). It distinguishes itself from siblings by warning not to call after leads.find, establishing it as a pre-search step.

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?

The description provides explicit step-by-step usage: first turn with just idea, then subsequent turns with history. It also states when not to use ('Do NOT call idea.refine after leads.find has already run') and implies alternatives (leads.find, idea.expand).

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