LeadFlow MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| LEADFLOW_DB | No | SQLite path, or `:memory:`. | ./data/leadflow.sqlite |
| LEADFLOW_NOW | No | Pins the clock. For demos and tests. Leave it unset on a real desk. | |
| LEADFLOW_SEED | No | `auto` seeds an empty database. `always` wipes and reseeds (Node only; the Worker ignores it). `never` leaves it empty. | auto |
| LEADFLOW_HTTP_HOST | No | Bind address. Any non-loopback host requires `LEADFLOW_AUTH_TOKEN`. | 127.0.0.1 |
| LEADFLOW_HTTP_PORT | No | HTTP port. `0` picks a free port. | 8787 |
| LEADFLOW_LOG_LEVEL | No | Log level: `debug`, `info`, `warn`, or `error`. JSON lines on stderr. | info |
| LEADFLOW_AUTH_TOKEN | No | Bearer token, at least 16 characters. Required off loopback and on the Worker. | |
| LEADFLOW_STALE_DAYS | No | Quiet-open-lead window, 1–90. | 7 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| prompts | {
"listChanged": true
} |
| resources | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| create_leadA | Add a lead to the shop pipeline. Money is integer cents (480000 = $4,800.00), never dollars. Pass an idempotencyKey when retrying so a duplicate submit returns the original lead. A reused key with a different payload is a conflict. The response includes the rule-based priority score. |
| update_leadA | Change fields on one lead. Send only the fields that change. Pass expectedUpdatedAt from the last read to reject a stale write. Null clears phone, email, city, or notes. Money stays in integer cents. |
| get_leadA | Read one lead with its priority score, interactions, and follow-ups. Use this before drafting outreach so the reply stays inside the recorded facts. |
| search_leadsA | Search the pipeline. Text matches name, service, city, email, phone, and notes, case-insensitive for ASCII. Results are ranked inside the 500 most recently updated matches. When truncated is true, narrow the query. Scores are computed, not stored. |
| score_leadA | Explain the priority score for one lead. The score is a published sum of source, reachability, urgency, value, stage, and recency, then a cap. It is not persisted and it does not call a model. Read leadflow://scoring-model for the rubric. |
| log_interactionA | Record a call, email, SMS, visit, or note on a lead. Summary should be the facts of the conversation, not a guess. Pass an idempotencyKey on retry. Omitting occurredAt stamps the server clock, and that default is not part of the idempotency hash. A supplied occurredAt is stored as UTC. The lead updatedAt stays on the server clock, so a backdated note does not sink the lead in search. |
| schedule_follow_upA | Schedule a follow-up for a lead. dueAt may be in the past, which makes it due immediately. Offset and Z spellings of the same instant are equivalent, including for the idempotency key. Pass an idempotencyKey on retry. |
| set_follow_up_statusA | Mark a follow-up scheduled, done, or cancelled. Setting the same status again is safe and does not rewrite the lead. Done and cancelled items drop out of list_due_follow_ups. |
| list_due_follow_upsA | List scheduled follow-ups whose dueAt is at or before asOf (default: server clock). Ordered soonest first. This is the front desk call list. |
| pipeline_summaryB | Counts by stage, open pipeline value in cents, win rate among closed leads (won / (won + lost)), and open leads with no activity for staleAfterDays (default 7). Win rate is null when nothing has closed. |
| export_leads_csvA | Export leads as CSV text. Cells that start with =, +, -, or @, including after leading whitespace, tab, or CR, are prefixed with an apostrophe so a spreadsheet will not treat them as formulas. Quotes, commas, and newlines are escaped. The export caps at 5000 rows and sets truncated when that happens. Money is integer cents. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| daily_follow_up_briefing | Build a front-desk briefing from the live pipeline and the follow-ups that are due. The model must not invent prices, times, or promises. |
| draft_follow_up | Draft a follow-up for one lead from the recorded facts. The model must not invent discounts or appointment times. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| pipeline | Stage counts, win rate, open value, and stale leads as JSON. |
| scoring_model | The published point rubric used by score_lead. No model is called. |
| Ellis Ward | new · Kitchen sink leak |
| Quinn Harper | proposal · Sewer scope and cleanout |
| Jonah Feldman | proposal · Primary bathroom remodel |
| Marina Cho | proposal · Tankless water heater install |
| Luis Ortega | new · No hot water |
| Priya Nandakumar | contacted · Main line clog |
| Helen Okonkwo | won · Sump pump replacement |
| Rowan Blake | qualified · Outdoor faucet winterize |
| Chris Dalton | lost · Whole-house repipe quote |
| Samira Adeyemi | contacted · Water heater flush |
TDQS
Scored across 11 tools
Each tool targets a clearly distinct resource and action: leads (create/get/update/search), follow-ups (list/schedule/set status), interactions (log), and analytics/export (pipeline_summary, score_lead, export_leads_csv). There is no meaningful overlap between search_leads and list_due_follow_ups, or between update_lead and set_follow_up_status.
Most tools follow a predictable snake_case verb_noun pattern such as create_lead, get_lead, log_interaction, and schedule_follow_up. pipeline_summary is a noun-only outlier, and export_leads_csv adds an extra noun, but the convention remains easy to follow.
The 11-tool surface is well scoped for a lead-management CRM, covering leads, follow-ups, interactions, analytics, and export without obvious filler. Each tool earns its place in the workflow.
Core lead CRUD (create, read, update, search) and the follow-up lifecycle (schedule, list due, mark status) are covered, along with logging interactions and pipeline analytics. The main gap is the absence of delete_lead or interaction management beyond logging, but normal sales workflows remain fully supported.