Orion Photo Group

Orion CRM · MCP server

This app is the system of record for the Orion Photo Group demo: clients, talent, bookings, galleries and albums, cases and the open-jobs board. Decagon reaches it through one MCP server (synced as native mcp_ tools). Every console view polls the same data, so each tool call shows up here turn by turn.

Connect Decagon

MCP URL
Transport Streamable HTTP, JSON-RPC 2.0 (initialize, tools/list, tools/call)
Auth None. Synthetic demo data only (same as the Decagon Bank demo).
Tool catalog
  1. Decagon → Build → Integrations → MCP → add the URL above, then Sync. Tools appear as mcp_<name>.
  2. Re-sync whenever a tool's name or arguments change; review the diff before applying (sync overwrites local edits to synced tools).
  3. Outbound: Decagon places the call itself. start_photographer_outreach returns dial details and the call_photographer coded tool runs Conversation.schedule_mission_run. The app holds no Decagon credentials; Admin → Settings only needs the campaign ID and Decagon number.

Demo flows (3)

A · Jake (client)

“Where's my photographer?” → session starts in ≤30 min, not checked in → live call to Marcus (MyPhone) → ETA written to the booking → relayed in chat → “Thank you!” → conversation closes with no reply.

Nicole: situation 4 (thank-you close)

B · Jake (client)

“Where's my album? I sent my design form 3 weeks ago” → stage from the production tracker → “My gallery is late, I want a refund” → guardrail → case with summary, canned handoff, chat closes.

Nicole: situations 1 and 3

C · Sarah (talent)

“Confirm my arrival time and venue for Saturday's wedding” → call sheet → “What else is in the area?” → agent asks dates + location → “this weekend” / “yes, my location here in Manhattan” → carousel of 5 NYC jobs (of 10), highlighted on the Orion map.

Nicole: situation 2

Metadata contract

KeyExampleSet byUsed for
member_idCL-10482 / TL-20771Orion web app (widget setMetadata) at loginget_member_context automation; every member tool
member_typeclient / talentOrion web appAOP visibility: client AOPs vs talent AOP
first_nameJakeOrion web appGreeting before the automation returns
personajake / sarahOrion web appDemo filtering in Conversations
outbound_reasonphotographer_eta_checkstart_photographer_outreach (campaign metadata)Force-visibility of the outbound voice AOP + welcome message
booking_idBK-58213start_photographer_outreach (campaign metadata)get_outreach_call_brief / record_outreach_result on the call

Tool results are read straight off the tool (@mcp_get_client_bookings.next_booking_id), not copied into metadata.

Decagon configuration (team 5766)

Automation

Before conversation start: mcp get_member_context(member_id = metadata.member_id, phone = caller phone on voice). Loads the logged-in member live from the CRM so the first reply already knows who it is talking to.

AOPs

Client: Session day & photographer statusChat + Voicemetadata.member_type == client

get_client_bookings → start_photographer_outreach → call_photographer → post_status_update → wait_for_outreach_result (loop) → get_outreach_status

Find today's session. If it starts within 30 minutes and the photographer has not checked in, tell the client you are calling the photographer now and start the outreach; wait for the result and relay ETA + message. Otherwise share the arrival time. If the wait times out, say the call is still in progress and use get_outreach_status when they ask again.

Client: Gallery & album statusChat + Voicemetadata.member_type == client

get_client_orders

Answer where the album / gallery is: current stage, what is done, what is next and the estimated date. Be honest when it is late. Never offer refunds or credits (the refund guardrail handles that).

Talent: Assignments & nearby opportunitiesChat + Voicemetadata.member_type == talent

get_talent_assignments · search_nearby_jobs → show_jobs_carousel (chat)

Confirm arrival time and venue address from the assignment. For 'what's in the area', ask which dates and which location (offer their saved home base) if not given, then search and show the carousel; on voice read the top three.

Outbound: Photographer ETA checkVoice (outbound campaign)metadata.outbound_reason == photographer_eta_check (Force Visibility)

get_outreach_call_brief → record_outreach_result → hang_up

Disclose AI, confirm it is the photographer, explain the client is asking for an ETA, capture ETA and any message, read it back, record it, thank them and hang up. Voicemail: leave a short message, record reached=false.

Refund request handoff (guardrail AOP)Chat + VoiceRun by guardrail only

create_case → send_handoff_and_close

Open a high-priority case with a full summary (order, stage, days late, what the client asked for), then send the canned handoff message and close the chat. No AI-written reply.

Guardrails

Refund or compensation request (User input · LLM → AOP: Refund request handoff)

The user asks for a refund, money back, a credit, a discount or compensation for any Orion order, gallery, album or session.

Gratitude close (User input · LLM → Tool: close_without_reply)

The user's message only expresses thanks or a sign-off (e.g. 'thank you so much!', 'great, thanks') and contains no new question or request.

MCP tools (12)

Conversation context used by Before-conversation-start automation (chat + voice)

get_member_contextread-onlyGet member context

Look up the logged-in Orion member from the CRM at the start of every conversation (before-conversation-start automation). Tells the agent whether this is a client or talent and gives the key facts for routing: name, contact details and their next booking. Pass metadata.member_id; on voice without metadata pass the caller phone.

member_idstring | nullOrion member ID: CL-xxxxx for clients, TL-xxxxx for talent. Read it from metadata.member_id (the logged-in Orion app sets it). Blank falls back to the member matching `phone`.
phonestring | nullCaller phone in any format. Used only when member_id is blank (voice calls without metadata).

returns found, member_id, member_type (client|talent), first_name, last_name, email, phone, tier (client), neighborhood_or_home_base, role (talent), next_booking_id, next_booking_title, next_booking_starts_at, next_booking_starts_local, next_booking_minutes_until_start, next_booking_venue, open_case_count, error

Client sessions & deliverables used by Client: Session day & photographer status · Client: Gallery & album status

get_client_bookingsread-onlyGet client bookings

List a client's upcoming (and today's) sessions with the assigned photographer, venue, start time, minutes until start, whether the photographer has checked in on site, and the status of any live outreach to the photographer. Use when a client asks about a session or where their photographer is.

member_idstring | nullOrion member ID: CL-xxxxx for clients, TL-xxxxx for talent. Read it from metadata.member_id (the logged-in Orion app sets it). Blank falls back to the member matching `phone`.
phonestring | nullCaller phone in any format. Used only when member_id is blank (voice calls without metadata).

returns client_name, count, bookings[{booking_id, title, session_type, status, starts_at, starts_local, minutes_until_start, photographer_name, photographer_first_name, photographer_checked_in, photographer_due_on_site_local, venue_name, venue_address, package, outreach_status}], next_booking_id, next_booking_minutes_until_start, error

get_client_ordersread-onlyGet client galleries & albums

Get the status of a client's deliverables (online gallery and printed album) from the production tracker: current stage, every stage with dates, the delivery promise, whether it is late and by how many days, and the next estimated milestone. Use for 'where is my album/gallery' questions. Never promise a date earlier than estimated_delivery_local.

member_idstring | nullOrion member ID: CL-xxxxx for clients, TL-xxxxx for talent. Read it from metadata.member_id (the logged-in Orion app sets it). Blank falls back to the member matching `phone`.
phonestring | nullCaller phone in any format. Used only when member_id is blank (voice calls without metadata).
kindgallery | album | anyFilter to one deliverable type; default any.

returns client_name, count, orders[{order_id, kind, title, stage, stage_number, stage_count, stages_done[], next_stage, stage_entered_local, days_in_stage, promised_local, is_late, days_late, estimated_next_milestone_local, estimated_delivery_local, editor, notes}], error

Live photographer outreach used by Client: Session day (chat) · Outbound: Photographer ETA check (voice)

start_photographer_outreachwrites CRMCall the photographer now

Start live outreach to the booking's photographer: marks the booking 'calling' in the CRM and returns the dial details (dial_target, decagon_phone_number, mission_id, call_metadata_json) that the call_photographer tool passes to Conversation.schedule_mission_run. Call this only after the AOP has decided outreach is warranted (the session starts within the outreach window and the photographer has not checked in). Then call call_photographer when should_dial is true, then wait_for_outreach_result. Idempotent: while a call is already in progress it returns should_dial=false.

booking_id*stringBooking ID, e.g. BK-58213, from get_client_bookings or get_talent_assignments.
reasonstring | nullOne line for the photographer, e.g. 'Client is at Bow Bridge and asking for your ETA.'
conversation_idstring | nullThis chat's Decagon conversation ID, if available, so the CRM links the call to the chat.

returns ok, booking_id, outreach_status (calling|failed), already_in_progress, should_dial, dial_target, decagon_phone_number, mission_id, scheduled_at_utc, call_metadata_json, photographer_first_name, photographer_name, calling_number_last4, started_at, error (booking_not_found | outbound_not_configured)

wait_for_outreach_resultread-onlyWait for the photographer call result

Wait for the outbound call to the photographer to finish. Watches the booking's outreach field for up to max_wait_seconds (default 20) and returns the moment the result is in. done=false means the call is still going: call this again (or, if the client asks later, use get_outreach_status). When done, tell the client the photographer's ETA and message in plain words.

booking_id*stringBooking ID, e.g. BK-58213, from get_client_bookings or get_talent_assignments.
max_wait_secondsnumberHow long to wait inside this call, 1-25 seconds (default 20).

returns done, outreach_status (not_started|calling|completed|no_answer|failed), reached, eta_minutes, eta_local, running_late, photographer_message, summary, seconds_waited, seconds_since_call_started, error

get_outreach_statusread-onlyGet photographer outreach status

Instant read of the live-outreach field on a booking (no waiting). Use when the client asks for an update after wait_for_outreach_result timed out, or later in the conversation.

booking_id*stringBooking ID, e.g. BK-58213, from get_client_bookings or get_talent_assignments.

returns done, outreach_status, reached, eta_minutes, eta_local, running_late, photographer_message, summary, started_at, completed_at, attempts, error

get_outreach_call_briefread-onlyGet outreach call brief

Outbound voice AOP: load what the photographer needs to hear at the start of the call: who is asking, the session, venue and start time, and how late they are relative to their on-site time. Pass metadata.booking_id from the campaign.

booking_id*stringBooking ID, e.g. BK-58213, from get_client_bookings or get_talent_assignments.

returns booking_id, photographer_first_name, client_name, client_first_name, session_type, venue_name, venue_address, starts_local, minutes_until_start, due_on_site_local, minutes_past_due_on_site, reason, onsite_contact, error

record_outreach_resultwrites CRMRecord photographer call result

Outbound voice AOP: write what the photographer said back to the CRM booking. Call once, before ending the call, whatever happened (reached=false for voicemail or no answer). This is what the client's chat is waiting on.

booking_id*stringBooking ID, e.g. BK-58213, from get_client_bookings or get_talent_assignments.
reached*booleantrue when the photographer was on the line.
eta_minutesnumber | nullMinutes until they arrive on site, as they said it ('ten minutes' = 10).
running_lateboolean | nulltrue if they will arrive after the session start time.
photographer_messagestring | nullAnything they asked you to pass on to the client, in their words.
summarystring | nullOne sentence for the CRM, e.g. 'Marcus is on the 1 train, 10 minutes out, apologizes for the delay.'
call_conversation_idstring | nullThis call's Decagon conversation ID, if available.

returns ok, booking_id, outreach_status (completed|no_answer), eta_local, error

Talent assignments & opportunities used by Talent: Assignments & nearby opportunities

get_talent_assignmentsread-onlyGet talent assignments

List a talent member's upcoming assignments with everything needed to confirm a shoot: arrival time on site, start time, venue name and full address, on-site contact and the call sheet (parking, dress code, notes). Use when a photographer asks to confirm arrival time or venue.

member_idstring | nullOrion member ID: CL-xxxxx for clients, TL-xxxxx for talent. Read it from metadata.member_id (the logged-in Orion app sets it). Blank falls back to the member matching `phone`.
phonestring | nullCaller phone in any format. Used only when member_id is blank (voice calls without metadata).

returns talent_name, home_base, count, assignments[{booking_id, title, session_type, day_local, arrival_local, starts_local, ends_local, venue_name, venue_address, onsite_contact, call_sheet, client_name}], error

search_nearby_jobsread-onlySearch open jobs near the talent

Find open Orion jobs for a talent member by date window and location: returns only jobs inside the window, within radius_miles of the location, and not clashing with the talent's own assignments. Collect the date window and location from the talent first (e.g. 'this weekend', 'my location in Manhattan' = near=home_base). Each job carries a destination photo (image_url) for the chat carousel and highlights on the Orion talent map.

member_idstring | nullOrion member ID: CL-xxxxx for clients, TL-xxxxx for talent. Read it from metadata.member_id (the logged-in Orion app sets it). Blank falls back to the member matching `phone`.
date_window*this_weekend | next_weekend | next_7_days | customWhich dates the talent asked about. 'custom' uses start_date/end_date.
start_datestring | nullCustom window start (YYYY-MM-DD), only for date_window=custom.
end_datestring | nullCustom window end inclusive (YYYY-MM-DD), only for date_window=custom.
nearstring | null'home_base' (their saved location) or a NYC neighborhood/borough they named. Default home_base.
radius_milesnumberSearch radius in miles (default 15).

returns count, window_label, near_label, radius_miles, excluded_conflicts, excluded_out_of_area, jobs[{job_id, title, client_type, day_local, time_local, duration_minutes, pay, pay_label, location_name, address, borough, miles_away, image_url, map_url, tags, description}], talent_map_url, error

Cases used by Refund request handoff (guardrail AOP)

create_casewrites CRMCreate CRM case

Open a case in the Orion CRM for a human specialist, with a summary of the conversation so the client never has to repeat themselves. Used by the refund-request handoff: the AI does not decide refunds. Returns the case number to reference.

member_idstring | nullOrion member ID: CL-xxxxx for clients, TL-xxxxx for talent. Read it from metadata.member_id (the logged-in Orion app sets it). Blank falls back to the member matching `phone`.
case_type*refund_request | complaint | reschedule | generalWhat the case is about.
subject*stringShort subject line, e.g. 'Refund request: wedding gallery 8 days late'.
summary*stringThree to five sentences: what the client asked for, the facts from the CRM (order, stage, days late), their tone, and what they want.
prioritylow | normal | high | urgentDefault high for refund requests and upset clients.
related_order_idstring | nullOrder ID the request is about, if known (e.g. ORD-7731).
conversation_idstring | nullDecagon conversation ID, if available.

returns ok, case_id, queue, priority, status, sla_label, error

Demo control used by Presenter only

reset_demowrites CRMReset demo data

Rebuild the CRM from the demo baseline (times re-anchored to now) and clear the activity feed. Presenter control only; never call in a customer conversation.

returns ok, error

Coded tools (Python, in Decagon)

show_jobs_carousel · Renders search_nearby_jobs results as a chat carousel with destination photos.

jobs = search_nearby_jobs.get("jobs") or []   # input variable mapped to @search_nearby_jobs.jobs
if jobs:
    Conversation.set_item_carousel({
        "title": f"Open jobs {search_nearby_jobs.get('window_label', '')}",
        "card_size": "medium",
        "items": [{
            "card_id": j["job_id"],
            "title": j["title"],
            "subtitle": f"{j['location_name']} · {j['miles_away']} mi",
            "image_url": j["image_url"],
            "badges": [{"label": j["pay_label"], "position": "top-left"}],
            "tags": [j["day_local"], j["time_local"]],
            "description": j["description"],
            "actions": {"chips": [
                {"label": "I'm interested", "handler": None, "url": None},
                {"label": "View on map", "url": j["map_url"]},
            ]},
            "on_click": {"type": "send_message", "text": f"Tell me more about {j['title']} ({j['job_id']})."},
        } for j in jobs],
    }, {"generate_ai_message": True, "send_after_message": True})
return {"shown": len(jobs)}

call_photographer · Places the outbound voice call natively in Decagon (no API key in the app), using the dial details from start_photographer_outreach.

import json
o = start_photographer_outreach   # input variable mapped to @mcp_start_photographer_outreach
if not o.get("should_dial"):
    return {"dialed": False, "reason": "already_in_progress_or_not_configured"}
Conversation.schedule_mission_run(
    mission_id=o["mission_id"],
    recipient=o["dial_target"],
    decagon_phone_number=o["decagon_phone_number"],
    scheduled_at_utc=o["scheduled_at_utc"],
    metadata=json.loads(o["call_metadata_json"]),
    recipient_country_code="US",
)
return {"dialed": True}

post_status_update · Writes an interim message immediately (e.g. 'Calling Marcus now…') before the agent waits on the call.

Conversation.write_message(message)
return {"ok": True}

send_handoff_and_close · Deterministic, professional handoff message, then ends the chat (no AI reply).

Conversation.write_message(
    f"Thank you, {first_name}. I've passed your request to our Client Care team with a full summary "
    f"(case {case_id}). A specialist will contact you directly within 4 business hours. This chat will now close."
)
Conversation.close()
Conversation.stop_writing()
return {"closed": True}

close_without_reply · Recognizes a thank-you and closes the conversation without sending anything.

Conversation.close()
return {"closed": True}

Error contract

member_not_foundNo client or talent matches member_id / phone.
not_a_client / not_talentThe member exists but is the other persona type.
booking_not_foundNo booking with that ID.
outbound_not_configuredCampaign ID or Decagon number missing (Admin → Settings).
invalid_dateCustom dates are not YYYY-MM-DD.
invalid_inputArguments failed validation (details in `detail`).

Every result has an error field (null on success), so AOPs branch with a coded condition instead of parsing text.

REST API (same logic as MCP)

GET /api/public/tools # catalog with JSON schemas

POST /api/public/tools/<tool> # body = arguments → { ok, tool, result }

GET /api/public/state # whole CRM + activity (console polling)

POST /api/public/admin # { action: reset | settings | save_entity }

GET /img/<job_id> # destination photo redirect for carousels

curl -s -X POST https://<this-app>/api/public/tools/search_nearby_jobs \
  -H 'content-type: application/json' \
  -d '{"member_id":"TL-20771","date_window":"this_weekend","near":"home_base"}'