Skip to main content
Glama
crazyrabbitLTC

Vibe-Coder MCP Server

provide_clarification

Clarify coding feature requirements by submitting questions and answers to guide structured development workflows.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
featureIdYes
questionYes
answerYes

Implementation Reference

  • The main handler function for the 'provide_clarification' tool. It validates input using the schema, retrieves the feature, appends the clarification response, saves it, determines the next question, and returns appropriate response.
    const provideClarificationHandler: ToolHandler<z.infer<typeof ProvideClarificationSchema>> = async (params) => {
      try {
        const { featureId, question, answer } = ProvideClarificationSchema.parse(params);
        
        console.log(`\n[CLARIFICATION] Received request for feature ${featureId}\n  Question: "${question.substring(0, 50)}..."\n  Answer: "${answer.substring(0, 50)}..."`);
        
        // Get the feature
        const feature = getFeature(featureId);
        if (!feature) {
          console.log(`[CLARIFICATION] Feature ID ${featureId} not found`);
          return featureNotFoundError(featureId);
        }
        
        console.log(`[CLARIFICATION] Found feature: ${feature.name} with ${feature.clarificationResponses.length} existing responses`);
        
        // Add the clarification response to the feature
        feature.clarificationResponses.push({
          question,
          answer,
          timestamp: new Date()
        });
        
        console.log(`[CLARIFICATION] Added response, now has ${feature.clarificationResponses.length} responses`);
        
        // Save the feature with the updated clarification response
        updateFeature(featureId, feature);
        
        // Get the next question or indicate all questions are answered
        const nextQuestion = getNextClarificationQuestion(feature);
        
        if (nextQuestion) {
          // Check if nextQuestion is a string before using substring
          const questionPreview = typeof nextQuestion === 'string' 
            ? nextQuestion.substring(0, 50) + "..." 
            : "All questions answered";
          console.log(`[CLARIFICATION] Returning next question: "${questionPreview}"`);
          return {
            content: [{
              type: "text",
              text: `Response recorded. ${nextQuestion}`
            }]
          };
        } else {
          // All questions answered
          console.log(`[CLARIFICATION] All questions answered`);
          return {
            content: [{
              type: "text",
              text: "All clarification questions have been answered. You can now generate a PRD for this feature."
            }]
          };
        }
      } catch (error) {
        if (error instanceof z.ZodError) {
          const errorMessage = error.errors.map(e => `${e.path.join('.')}: ${e.message}`).join(', ');
          return createToolErrorResponse(`Validation error: ${errorMessage}`);
        }
        return createToolErrorResponse(error instanceof Error ? error.message : "Unknown error");
      }
    };
  • Zod schema defining the input parameters for the provide_clarification tool: featureId, question, and answer.
    const ProvideClarificationSchema = z.object({
      featureId: z.string().min(1),
      question: z.string().min(1),
      answer: z.string().min(1)
    });
  • Registration of the 'provide_clarification' tool in the toolRegistry, including name, handler, description, JSON schema, and examples.
    toolRegistry.register(
      'provide_clarification', 
      provideClarificationHandler,
      'Provide answer to a clarification question',
      {
        type: "object",
        properties: {
          featureId: {
            type: "string",
            description: "ID of the feature"
          },
          question: {
            type: "string",
            description: "Clarification question"
          },
          answer: {
            type: "string",
            description: "Answer to the clarification question"
          }
        },
        required: ["featureId", "question", "answer"]
      },
      [
        {
          featureId: "feature-123",
          question: "What problem does this feature solve?",
          answer: "This feature solves the problem of users forgetting their passwords by providing a secure password reset flow."
        },
        {
          featureId: "feature-456",
          question: "Who are the target users?",
          answer: "The target users are administrators who need to manage user accounts and permissions."
        }
      ]
    );
  • Alternative direct implementation of the 'provide_clarification' tool using server.tool, with inline schema and handler logic similar to tool-handlers.ts.
    server.tool(
      "provide_clarification",
      {
        featureId: z.string().min(1),
        question: z.string().min(1),
        answer: z.string().min(1)
      },
      async ({ featureId, question, answer }) => {
        // Get the feature
        const feature = getFeature(featureId);
        if (!feature) {
          throw new Error(`Feature ${featureId} not found`);
        }
        
        // Add the clarification response to the feature
        feature.clarificationResponses.push({
          question,
          answer,
          timestamp: new Date()
        });
        
        // Save the feature with the updated clarification response
        updateFeature(featureId, feature);
        
        // Get the next question or indicate all questions are answered
        const nextQuestion = getNextClarificationQuestion(feature);
        
        if (nextQuestion) {
          return {
            content: [{
              type: "text",
              text: `Response recorded. ${nextQuestion}`
            }]
          };
        } else {
          // All questions answered
          return {
            content: [{
              type: "text",
              text: "All clarification questions have been answered. You can now generate a PRD for this feature."
            }]
          };
        }
Behavior1/5

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

Tool has no description.

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

Conciseness1/5

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

Tool has no description.

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

Completeness1/5

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

Tool has no description.

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

Parameters1/5

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

Tool has no description.

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

Purpose1/5

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

Tool has no description.

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

Usage Guidelines1/5

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

Tool has no description.

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/crazyrabbitLTC/mcp-vibecoder'

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