Spaces:
Runtime error
A newer version of the Gradio SDK is available: 6.13.0
title: Conversational Form Agent
emoji: ๐
colorFrom: pink
colorTo: red
sdk: gradio
sdk_version: 5.49.1
app_file: app.py
pinned: false
short_description: MCP-powered conversational agent that replaces traditional f
tags:
- mcp
- conversational-ai
- form-filling
- track-1
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
๐ฌ Conversational Form Agent - MCP 1st Birthday Hackathon
Track 1: Building with MCP
A revolutionary approach to form filling powered by the Model Context Protocol (MCP). Say goodbye to traditional web forms and hello to intelligent, conversational data collection.
๐ฏ The Problem
Traditional web forms are:
- Overwhelming: Users face a wall of empty fields
- Inflexible: Fixed order and no guidance
- Error-prone: Validation happens after submission
- Frustrating: No context or help during filling
โจ The Solution
This MCP-powered agent transforms forms into natural conversations:
- Asks questions one at a time
- Validates input immediately
- Provides helpful feedback
- Remembers your progress
- Submits when complete
๐๏ธ Architecture
Built entirely with the Model Context Protocol (MCP), this project demonstrates how MCP tools can create intelligent, stateful conversational agents.
MCP Tools (5 Required Tools)
get_form_schema()- Returns the complete form definition as JSON
- Defines fields, types, validation rules, and prompts
get_next_question(filled_data)- Intelligently determines which question to ask next
- Takes already-filled data as input
- Returns the next unanswered required field
validate_answer(field_name, value)- Validates user input against field rules
- Checks data types (email, phone, text, choice)
- Enforces required fields
- Returns validation status and error messages
save_answer(field_name, value)- Stores validated answers in session state
- Maintains conversation progress
- Enables recovery from interruptions
submit_form(filled_data)- Submits the complete form data
- Generates unique submission ID
- Returns confirmation message
System Flow
User starts โ Agent greets โ get_form_schema() โ get_next_question()
โ
Ask question
โ
User responds โ validate_answer()
โ
Valid? โ save_answer() โ All done? โ submit_form() โ Success!
โ โ
No? โ Show error โ Ask again
โ
No? โ get_next_question() โ Continue
๐ Features
- Conversational Interface: Natural Q&A flow instead of form fields
- Real-time Validation: Immediate feedback on every answer
- Progress Tracking: Always knows where you are in the form
- Smart Navigation: Automatically moves to next question
- Error Handling: Clear, helpful error messages
- Session Management: Remembers your answers
- MCP-Powered: All functionality through MCP tool calls
๐ Current Form Schema
The agent currently handles a Job Application Form with:
- Full Name (text, required)
- Email Address (email format, required)
- Phone Number (phone format, required)
- Years of Experience (number, required)
- Desired Role (choice from list, required)
- Availability (choice from list, required)
๐ฎ How to Use
- Launch the Space: This app runs automatically on Hugging Face Spaces
- Start the conversation: Type "start" or "begin" in the chat
- Answer questions: The agent asks one question at a time
- Get validation: Receive immediate feedback on your answers
- Complete the form: Submit when all questions are answered
Example Interaction
Agent: Welcome! I'll help you complete the job application form.
Let's get started!
Agent: What is your full name?
You: John Smith
Agent: Great! What is your email address?
You: john@email
Agent: Invalid email. Please enter a valid email address.
You: john.smith@email.com
Agent: Perfect! What is your phone number? (Format: XXX-XXX-XXXX)
You: 555-123-4567
Agent: Thanks! How many years of experience do you have?
[... continues until form is complete ...]
Agent: Form submitted successfully! Your submission ID is: sub_abc123xyz
๐ ๏ธ Technical Stack
- Framework: Gradio 4.0+ (for web interface)
- Protocol: Model Context Protocol (MCP)
- Language: Python 3.10+
- Deployment: Hugging Face Spaces
- Storage: In-memory session state
๐ Project Structure
Conversational-Form-Agent/
โโโ app.py # Main Gradio application with MCP tools
โโโ requirements.txt # Python dependencies
โโโ README.md # This file
โโโ LICENSE # MIT License
๐ Hackathon Compliance (Track 1)
This project fully complies with the MCP 1st Birthday Hackathon requirements:
โ Track 1: Building with MCP - All functionality implemented as MCP tools โ Public Repository - Open source on Hugging Face Spaces โ Complete Documentation - Comprehensive README with architecture โ Working Demo - Fully functional live application โ MCP Tool Specification - 5 required tools implemented and documented โ Open Source License - MIT Licensed โ Ready for Judging - Deployed and accessible
๐ฎ Future Enhancements
- Multi-form Support: Handle different form types dynamically
- Conditional Logic: Skip questions based on previous answers
- File Uploads: Support document and image uploads
- Multi-language: Support forms in multiple languages
- Analytics: Track completion rates and drop-off points
- Export Options: Download submissions as JSON/CSV
- Authentication: User accounts with saved progress
- API Integration: Submit to external systems
- Voice Input: Speak your answers instead of typing
- Accessibility: Enhanced screen reader support
๐ License
MIT License - See LICENSE file for details
๐ Acknowledgments
Built for the MCP 1st Birthday Hackathon - Celebrating the Model Context Protocol's first year of enabling intelligent, tool-based AI agents.
Ready to try it? Click the "App" tab above to start filling forms the conversational way! ๐