Skip to content

Mission: Hospital Operations Copilot using SQL MCP and a Custom HospitalOps Database #12

Description

@msup96

Mission/open goal Description

Instead of using the default Promptathon dataset, I chose to build a custom hospital operations analytics project.

I designed and imported a SQL Server database called HospitalOps, containing twelve interconnected entities representing patients, departments, encounters, staff, equipment, inventory, incident reports, bed occupancy, staff scheduling, and patient satisfaction.

My goal was to use SQL MCP to understand the schema, validate data quality, and generate operational intelligence that could support hospital administrators in monitoring departmental performance and identifying operational risks.

Rather than treating this as a SQL exercise, I approached it as an end-to-end analytics workflow involving database setup, MCP configuration, schema exploration, data validation, and operational reporting.

Harness and model

GitHub Copilot Agent with GPT-5.5 (primary development environment inside GitHub Codespaces). I also used Claude Sonnet for debugging strategy and ChatGPT (GPT-5.5) for workflow review, SQL refinement, documentation, and final submission preparation.

Turn-by-turn journey

1. Environment Setup

Prompt: Configure GitHub Codespaces to use my custom HospitalOps SQL Server database instead of the default PromptathonDb.

Agent response or action:

  • Imported the HospitalOps SQL script.
  • Connected SQL Server.
  • Updated the Data API Builder connection.
  • Restarted the MCP server.

Result:
SQL MCP successfully connected to the HospitalOps database.


2. Schema Discovery

Prompt: Explore the HospitalOps database using SQL MCP.

Agent response or action:

  • Listed accessible databases.
  • Discovered all entities.
  • Documented primary keys and foreign key relationships.
  • Generated schema documentation.

Result:
Created a complete understanding of the database structure before analysis.


3. Data Validation

Prompt: Validate data quality before generating operational insights.

Agent response or action:

  • Investigated encounter data.
  • Identified negative encounter durations.
  • Checked schema assumptions.
  • Verified available columns before writing analytical SQL.

Result:
Adjusted analytical queries to exclude invalid encounter durations instead of modifying the source data.


4. Operational Analytics

Prompt: Generate department-level operational KPIs.

Agent response or action:

  • Joined Departments, Encounters, IncidentReports, and PatientSatisfactionSurveys.
  • Calculated encounter counts.
  • Calculated average length of stay.
  • Calculated incident counts.
  • Calculated patient satisfaction metrics.

Result:
Produced a department operational dashboard summarizing hospital performance.


5. Documentation

Prompt: Produce reusable project documentation.

Agent response or action:
Generated:

  • Schema documentation
  • Data Quality Report
  • Executive Report
  • Architecture Diagram
  • Journey documentation

Result:
Completed a reproducible SQL MCP project with supporting documentation suitable for review.

Completion

  • Yes, the agent completed the mission or goal.
  • No, the agent did not complete the mission or goal.

Bonus work

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions