ask_followup_question
The ask_followup_question tool enables interactive communication by initiating targeted questions to collect supplementary information needed to complete tasks.
Parameter Description
This tool supports the following input parameters:
question(required): Specific question content to be asked to the userfollow_up(optional): List of suggested answers to guide user responses, containing 2-4 answers, each wrapped in<suggest>tags
Feature Overview
This tool establishes a dialogue interface between VJSP and users. When encountering ambiguous requirements or decision points, it can collect user clarifications, supplementary details, or preference settings. Each question can be accompanied by suggested answers to improve interaction efficiency.
Applicable Scenarios
- When core information is missing from the original request
- When VJSP needs to choose among multiple valid implementation options
- When advancing tasks requires clarifying technical details or user preferences
- When VJSP encounters demand ambiguities that need resolution
- When supplementary context can significantly improve solution quality
Core Features
- Provides structured information collection without interrupting business processes
- Includes suggested answers to reduce user input and guide response direction
- Retains dialogue history and context information across interaction sessions
- Supports response content containing images and code snippets
- As a component of the "globally available" toolset, supports all operation modes
- Allows users to directly guide implementation decision-making processes
- Formats response content using
<answer>tags to distinguish it from regular dialogue - Resets continuous error counter upon successful tool invocation
Limitations
- Single tool call only supports one specific question
- Suggested answers are displayed as optional options in the user interface
- Cannot force users to reply in structured format, still supports free input
- Excessive calls reduce task completion efficiency and create fragmented interaction experiences
- Suggested answers must be complete content, no placeholders requiring user editing
- No built-in user response validation mechanism
- No implementation mechanism to enforce specific answer formats
Execution Process
After calling the ask_followup_question tool, it will execute according to the following process:
Parameter Validation: Verify if the required
questionparameter exists and check the validity of optional suggested answers- Check if question text has been provided
- Parse suggested answers in the
follow_upparameter based onfast-xml-parserparsing library - Standardize even single suggested answers into array format
JSON Format Conversion: Convert XML-structured parameters to standardized JSON format for interface display
typescript{ question: "Specific question to the user", suggest: [ { answer: "Suggested answer 1" }, { answer: "Suggested answer 2" } ] }Interface Integration
- Pass JSON structure to UI layer via
ask("followup", ...)method - Display clickable suggested answer buttons in user interface
- Implement interactive experience of "select suggested answer/custom input"
- Pass JSON structure to UI layer via
Response Collection and Processing
- Capture user text input and images included in responses
- Wrap user responses in
<answer>tags and feed back to intelligent assistant - Retain all image content included in user responses
- Add user responses to dialogue history to maintain session context
- Reset continuous error counter upon successful tool invocation
Exception Handling
- Track continuous operation error count via counter
- Reset counter upon successful tool invocation
- Output targeted error messages:
- Missing parameter: "Required parameter 'question' is missing"
- XML parsing failure: "Operation parsing failed: [specific error message]"
- Invalid format: "Operation XML format is invalid"
- Built-in protection mechanism prevents tool execution when required parameters are missing
- Increment continuous error counter when errors occur
Interaction Flow
The question-answer interaction cycle follows this process:
- Identify Information Gaps: VJSP identifies missing information needed to advance tasks
- Create Targeted Questions: VJSP writes clear, goal-oriented question content
- Formulate Suggested Answers: VJSP generates relevant suggested answers (optional, recommended)
- Call Tool: Intelligent assistant calls this tool with questions and optional suggested answers
- Interface Display: Questions and suggested answers are displayed to users as interactive elements
- User Response: Users select suggested answers or input custom responses
- Message Processing: System processes partially submitted and complete messages
- For streaming responses, process block by block in order of arrival
- For complete messages, process all response content at once
- Maintain state consistency regardless of message chunking
- Response Processing: System wraps response content in
<answer>tags and retains images - Context Integration: Add user responses to dialogue history
- Task Continuation: VJSP continues executing tasks based on newly acquired information
Application Examples
- When developing web applications, VJSP can ask about preferred style frameworks (Bootstrap, Tailwind, custom CSS)
- When developing APIs, VJSP can ask about authentication methods (JWT, OAuth, API keys)
- When refactoring code, VJSP can ask about optimization priorities (performance first/readability first)
- When building databases, VJSP can ask about specific table structure design preferences
- When developing custom features, VJSP can ask about specific expectations for feature behavior
- When troubleshooting errors, VJSP can ask about specific environment configuration details
Response Format
When users reply to questions, content will be formatted with <answer> tags to ensure clarity and consistency. This format effectively distinguishes user response content from other dialogue elements.
Response format example:
<answer>
Choose Tailwind CSS to implement maximum flexibility based on a utility-first styling approach
</answer>Core features of response format:
- Content wrapped in
<answer>tags - Preserves original response formatting
- If response contains images, they are fully retained
- Even long text responses are completely returned
Call Example
Ask about implementation preferences:
<ask_followup_question>
<question>Which styling implementation approach do you prefer for this web application development?</question>
<follow_up>
<suggest>Choose Bootstrap to implement rapid development based on standardized components</suggest>
<suggest>Choose Tailwind CSS to implement maximum flexibility based on a utility-first styling approach</suggest>
<suggest>Choose native CSS to develop custom styles for complete control and minimal dependencies</suggest>
</follow_up>
</ask_followup_question>Request technical details clarification:
<ask_followup_question>
<question>Which database should be used to store user data for this application?</question>
<follow_up>
<suggest>Choose MongoDB to implement document storage based on flexible schema design</suggest>
<suggest>Choose PostgreSQL to implement strong consistency guarantees for relational data</suggest>
<suggest>Choose Firebase to implement real-time data updates and simplify backend management</suggest>
<suggest>Choose SQLite to implement lightweight local storage without external dependencies</suggest>
</follow_up>
</ask_followup_question>Resolve requirement ambiguities:
<ask_followup_question>
<question>How should user authentication functionality be implemented for this application?</question>
<follow_up>
<suggest>Implement email/password authentication with account verification process</suggest>
<suggest>Integrate social login providers (Google, GitHub, etc.) for quick registration and login</suggest>
<suggest>Implement both email/password authentication and social login</suggest>
</follow_up>
</ask_followup_question>