Skip to main content
Glama
gr3enarr0w

Claude Code Prompt Engineer

by gr3enarr0w

ask_clarification

Ask clarifying questions to understand user requirements and refine prompts for Claude Code engineering.

Instructions

Ask clarifying questions to better understand user requirements and refine the prompt engineering process.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesThe session ID for this prompt engineering session
questionsYesList of clarifying questions to ask the user

Implementation Reference

  • Executes the ask_clarification tool: validates arguments and responds with formatted clarifying questions for the user to answer using the answer_questions tool.
    case "ask_clarification": {
      if (!isClarificationArgs(args)) {
        throw new Error("Invalid arguments for ask_clarification");
      }
      
      const { sessionId, questions } = args;
      return {
        content: [{ 
          type: "text", 
          text: `Please answer these clarifying questions:\n\n${questions.map((q, i) => `${i + 1}. ${q}`).join('\n')}\n\nUse the answer_questions tool with session ID "${sessionId}" when ready.`
        }],
        isError: false,
      };
    }
  • JSON Schema defining the input parameters for the ask_clarification tool: sessionId (string, required) and questions (array of strings, required).
    inputSchema: {
      type: "object",
      properties: {
        sessionId: {
          type: "string",
          description: "The session ID for this prompt engineering session"
        },
        questions: {
          type: "array",
          items: { type: "string" },
          description: "List of clarifying questions to ask the user"
        }
      },
      required: ["sessionId", "questions"],
      title: "ask_clarificationArguments"
    }
  • index.ts:570-572 (registration)
    Registers the ask_clarification tool (as ASK_CLARIFICATION_TOOL) in the list of available tools returned by ListToolsRequestSchema.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [ENGINEER_PROMPT_TOOL, ASK_CLARIFICATION_TOOL, ANSWER_QUESTIONS_TOOL, AUTO_OPTIMIZE_TOOL],  
    }));
  • Type guard function used to validate the arguments passed to the ask_clarification tool handler.
    function isClarificationArgs(args: unknown): args is {
      sessionId: string;
      questions: string[];
    } {
      return (
        typeof args === "object" &&
        args !== null &&
        "sessionId" in args &&
        typeof (args as { sessionId: string }).sessionId === "string" &&
        "questions" in args &&
        Array.isArray((args as { questions: string[] }).questions)
      );
    }
  • Full Tool object definition for ask_clarification, including name, description, and input schema.
    const ASK_CLARIFICATION_TOOL: Tool = {
      name: "ask_clarification",
      description: "Ask clarifying questions to better understand user requirements and refine the prompt engineering process.",
      inputSchema: {
        type: "object",
        properties: {
          sessionId: {
            type: "string",
            description: "The session ID for this prompt engineering session"
          },
          questions: {
            type: "array",
            items: { type: "string" },
            description: "List of clarifying questions to ask the user"
          }
        },
        required: ["sessionId", "questions"],
        title: "ask_clarificationArguments"
      }
    };
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool asks questions to understand requirements, but doesn't reveal key traits: e.g., whether this is an interactive process with the user, how responses are handled, if there are rate limits, or what the expected outcome is. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

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 a single, efficient sentence that states the purpose clearly without unnecessary words. It's appropriately sized for a simple tool, but could be slightly improved by front-loading more specific context or usage hints to enhance clarity immediately.

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 tool's complexity (involving user interaction and prompt refinement), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects, usage context, or expected outcomes, making it inadequate for an AI agent to fully understand how to invoke and interpret this 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?

Schema description coverage is 100%, so the schema already documents both parameters ('sessionId' and 'questions') with descriptions. The description adds no additional meaning beyond what the schema provides—it doesn't explain the format of questions, how they relate to the session, or any constraints. Baseline 3 is appropriate when the schema does the heavy lifting.

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 tool's purpose: 'Ask clarifying questions to better understand user requirements and refine the prompt engineering process.' It specifies the verb ('ask') and the resource ('clarifying questions'), and it connects to the broader context of prompt engineering. However, it doesn't explicitly differentiate from sibling tools like 'answer_questions' or 'engineer_prompt', which might also involve user interaction or prompt refinement, so it doesn't reach the highest score.

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?

The description provides no guidance on when to use this tool versus alternatives. It mentions 'refine the prompt engineering process,' but doesn't specify scenarios, prerequisites, or exclusions. For example, it doesn't indicate if this should be used before 'engineer_prompt' or as an alternative to 'auto_optimize,' leaving the agent without clear usage instructions.

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/gr3enarr0w/cc_peng_mcp'

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