Manakavoo's picture
Update README.md
73e9445 verified

A newer version of the Gradio SDK is available: 6.13.0

Upgrade
metadata
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)

  1. get_form_schema()

    • Returns the complete form definition as JSON
    • Defines fields, types, validation rules, and prompts
  2. get_next_question(filled_data)

    • Intelligently determines which question to ask next
    • Takes already-filled data as input
    • Returns the next unanswered required field
  3. 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
  4. save_answer(field_name, value)

    • Stores validated answers in session state
    • Maintains conversation progress
    • Enables recovery from interruptions
  5. 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

  1. Launch the Space: This app runs automatically on Hugging Face Spaces
  2. Start the conversation: Type "start" or "begin" in the chat
  3. Answer questions: The agent asks one question at a time
  4. Get validation: Receive immediate feedback on your answers
  5. 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! ๐Ÿš€