# 🤖 $250 Community Challenge – Agent Mode Prompts | 5 days

**URL:** <https://community.postman.com/t/250-community-challenge-agent-mode-prompts-5-days/88214>\
**Category:** API Pulse\
**Tags:** challenge, agent-mode\
**Created:** [January 22, 2026, 11:12pm UTC](https://community.postman.com/t/250-community-challenge-agent-mode-prompts-5-days/88214 "2026-01-22T23:12:04Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![aryanGarg](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/aryangarg/32/8847_2.png) [@aryanGarg](https://community.postman.com/u/aryanGarg)\
**Post date:** [January 29, 2026, 9:18am UTC](https://community.postman.com/t/250-community-challenge-agent-mode-prompts-5-days/88214/10 "2026-01-29T09:18:22Z")

</div>

# Using Postman Agent Mode to Add Error Handling to Medicotest API

## The Prompt I Ran

**Prompt:** “Add detailed 4xx and 5xx error responses to each endpoint in this collection (Get clear and consistent error responses for your API endpoints)”

* * *

## What I Ran It On

**Project Context:** I’m building **Medicotest** - a healthcare platform where patients in India (especially Punjab) can upload medical reports (blood tests, X-rays, ultrasounds) and receive:

- AI-powered health diagnoses
- Affordable doctor recommendations (₹400-₹1500 consultation fees)
- Treatment plans with medicine costs
- Location-based doctor search
- Appointment booking

The API has **37 endpoints** across 7 categories:

- User Management (5 endpoints)
- Medical Reports Upload (7 endpoints)
- AI Diagnosis (5 endpoints)
- Doctor Discovery (7 endpoints)
- Treatment Plans (3 endpoints)
- Appointment Booking (7 endpoints)
- Health Tips (3 endpoint)

* * *

## What the Agent Handled

### Before Agent Mode

I had built all 37 endpoints with basic functionality:

```javascript
app.get('/api/users/:id', (req, res) => {
    const user = users.find(u => u.id === parseInt(req.params.id));
    
    if (!user) {
        return res.status(404).json({
            success: false,
            message: 'User not found'
        });
    }
    res.json({ success: true, data: user });
});

```

**My error handling was:**

- Inconsistent across endpoints
- Missing detailed error messages
- No validation error details
- Generic 500 errors
- No input validation messages
- Missing error codes

### After Running the Prompt

**The Postman Agent Mode automatically:**

1. **Added Comprehensive 4xx Errors** for all 18 endpoints:

2. **Added Detailed 5xx Errors** :

3. **Standardized Error Response Format** :

```json
{
  "success": false,
  "error": {
    "code": "RESOURCE_NOT_FOUND",
    "message": "User with ID 999 not found",
    "statusCode": 404,
    "timestamp": "2026-01-29T10:30:00.000Z",
    "path": "/api/users/999"
  }
}

```

1. **Added Validation Error Details** :

```json
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid input data",
    "statusCode": 400,
    "details": [
      {
        "field": "email",
        "message": "Invalid email format"
      },
      {
        "field": "phone",
        "message": "Phone number must be 10 digits"
      }
    ]
  }
}

```

1. **Enhanced Specific Endpoints** :

2. **Added Error Examples** to each endpoint’s documentation with:

* * *

## What I Didn’t Have to Do Anymore

### Manual Work Eliminated

**Before Agent Mode (Manual Process):**

1. Identify all possible error scenarios for 37 endpoints (2-3 hours)
2. Write error handling code for each scenario (4-5 hours)
3. Create a consistent error response format (1 hour)
4. Add validation logic for each field (3-4 hours)
5. Document error responses in Postman (2-3 hours)
6. Test each error scenario manually (3-4 hours)
7. Update error messages for consistency (1-2 hours)

**Total Manual Time:** ~16-22 hours

**With Agent Mode:** 15 minutes

- Type the prompt
- Agent analyzes all 37 endpoints
- Agent adds comprehensive error handling
- Agent updates documentation
- Ready to test!

* * *

## Why This Matters for Medicotest

**Medicotest will serve vulnerable populations** who need:

- Clear error messages in understandable language
- Guidance when upload fails (file size, format)
- Helpful feedback for form validation
- Confidence that their data is being handled properly

**Without Proper Errors:**

```auto
User uploads 15MB X-ray image
Response: "Error 500"
Result: User confused, thinks platform is broken, gives up

```

**With Agent Mode-Enhanced Errors:**

```auto
User uploads 15MB X-ray image
Response: {
  "error": {
    "code": "FILE_TOO_LARGE",
    "message": "Image size exceeds 10MB limit. Please compress your image.",
    "statusCode": 413,
    "details": {
      "maxSize": "10MB",
      "receivedSize": "15MB",
      "suggestion": "Try using image compression tools or reduce image quality"
    }
  }
}

Result: User understands the issue, compresses the image, and successfully uploads

```

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/8/7/87fd088702c49517a89b4168486249fc5697fa26.jpeg)

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/1/f/1f8d2edcda7c98180e10cac28ec0c75365b432cc.jpeg)

* * *

## Final Thoughts

As a solo developer building **Medicotest** to help people access affordable healthcare, **Agent Mode has been a game-changer**.

Agent Mode didn’t just save time - it **elevated the quality** of my API to enterprise standards. For a healthcare platform where **clear communication can literally help people get the care they need** , this is invaluable.

---

_[View the full topic](https://community.postman.com/t/250-community-challenge-agent-mode-prompts-5-days/88214)._
