MedBridge Sales Ops
Core Workflow
- Read the user prompt and the local
input/payloads/answer_template.jsonbefore querying records. Treat the template as the required output contract, including field names, array shapes, enum strings, number/date formats, and nullable fields. - Resolve the API base URL from the prompt, runner instructions, or environment access file. Use only the provided MedBridge Sales Ops API and its documented GET endpoints.
- Extract every stable identifier and exact business name from the prompt: customer IDs, quote IDs, RFQ IDs, opportunity IDs, product codes, event IDs, voucher codes, contacts, dates, and quantities.
- Query the API with those identifiers. Prefer direct endpoints for known IDs, use
/api/search?q=...for names and relationship discovery, and fetch full records before deriving final values. - Cross-check relationships across records. Do not trust a matching name or search hit unless the customer, opportunity, quote/RFQ, product, milestone, event, or voucher linkage agrees with the prompt and related records.
- Load references/answering-rules.md for pricing, freight, milestone, revenue-recognition, event, voucher, and action-routing rules.
- Produce only valid JSON matching the template. Do not include markdown, commentary, extra keys, or omitted required keys.
API Helper
Use scripts/medbridge_api.py to gather records repeatably:
python scripts/medbridge_api.py "$BASE_URL" --api
python scripts/medbridge_api.py "$BASE_URL" --search "customer or record id"
python scripts/medbridge_api.py "$BASE_URL" --get quotes "QUOTE_ID" --get customers "CUSTOMER_ID"
python scripts/medbridge_api.py "$BASE_URL" --list freight-quotes --list policies
The helper prints one JSON object containing every requested API response. Inspect the returned fields and relationships, then perform the business calculations yourself.
Output Discipline
- Clone template array objects when the API contains multiple applicable line items, freight options, milestones, or tasks.
- Preserve the template's field names and controlled values exactly. If a field's placeholder describes a type rather than a literal value, replace it with the derived value of that type.
- Use numeric JSON values for money and quantities, not strings. Round currency calculations to cents when the template asks for cent-level values.
- Use ISO
YYYY-MM-DDdates. Use the quote date or as-of date from the prompt when evaluating freight validity, receivables, and due-date actions. - Leave a field
nullonly when the template allows null or the underlying business value is genuinely absent. - Before final response, parse the JSON mentally or with a local parser and compare every top-level and nested key against
answer_template.json.