Ptally is an MCP server published by ai.ptally, hosted at app.ptally.ai. When last checked on 2026-11-24 it was working: it answers and lists its tools. It declares 18 tools, including get_docs, get_schema, validate_project, get_starter, get_projects.
Insurance pricing: build, validate and test rating models, then price quotes from your AI client.
Nothing else in the archive shares these values.
Squares are this server's values; dots are other servers sharing them. A shared address or publisher is a lead, not proof of a common operator.
Inferred from the host name and headers: what a server runs on, not who runs it.
Fetch Ptally documentation by topic. Call BEFORE building or editing a config to load the rules and reference material you need. Topics: "rules" = agent rules, constraints, expression syntax, quality gates, and debugging guidance (start here); "readme" = full engine reference with step types, query language, input/output blocks, and code examples.
| Parameter | Type | Description |
|---|---|---|
| topic * | string | Documentation topic. "rules" for agent rules and constraints (start here). "readme" for full engine reference. |
{
"name": "get_docs",
"title": "Guides",
"description": "Fetch Ptally documentation by topic. Call BEFORE building or editing a config to load the rules and reference material you need. Topics: \"rules\" = agent rules, constraints, expression syntax, quality gates, and debugging guidance (start here); \"readme\" = full engine reference with step types, query language, input/output blocks, and code examples.",
"inputSchema": {
"type": "object",
"required": [
"topic"
],
"properties": {
"topic": {
"enum": [
"rules",
"readme"
],
"type": "string",
"description": "Documentation topic. \"rules\" for agent rules and constraints (start here). \"readme\" for full engine reference."
}
}
},
"annotations": {
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true
}
}Fetch the full JSON schema for Ptally project config files. Use to check exact field requirements, allowed step types, and property constraints.
No parameters.
{
"name": "get_schema",
"title": "Model layout",
"description": "Fetch the full JSON schema for Ptally project config files. Use to check exact field requirements, allowed step types, and property constraints.",
"inputSchema": {
"type": "object"
},
"annotations": {
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true
}
}Server-side schema validation of a project config. Returns { valid: true/false, errors: [...] } with the JSON path, keyword, and message for each issue. Prefer local validation against get_schema during authoring; use this as a ground-truth check, including on an amended model before handing it back to the user as a file. Pass exactly one of inline `project` or a base64-gzipped `project_gz` (if the inline form is too large for your client); passing neither or both returns an error result.
| Parameter | Type | Description |
|---|---|---|
| project | object | |
| project_gz | string | Optional. Base64-encoded gzip of the project JSON, used as an alternative to inline `project` when the caller cannot fit the full payload in a single tool argument. Mutually exclusive with `project`. Model JSON typically compresses 5-10x. |
{
"name": "validate_project",
"title": "Check a model for mistakes",
"description": "Server-side schema validation of a project config. Returns { valid: true/false, errors: [...] } with the JSON path, keyword, and message for each issue. Prefer local validation against get_schema during authoring; use this as a ground-truth check, including on an amended model before handing it back to the user as a file. Pass exactly one of inline `project` or a base64-gzipped `project_gz` (if the inline form is too large for your client); passing neither or both returns an error result.",
"inputSchema": {
"type": "object",
"properties": {
"project": {
"type": "object",
"required": [
"meta",
"input",
"steps",
"output"
],
"properties": {
"meta": {
"type": "object"
},
"input": {
"type": "object"
},
"steps": {
"type": "array",
"items": {
"type": "object"
}
},
"tests": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"name",
"key",
"input",
"output"
],
"properties": {
"id": {
"type": "string"
},
"key": {
"type": "string"
},
"name": {
"type": "string"
},
"input": {
"type": "object"
},
"output": {
"type": "object",
"properties": {
"valid": {
"type": "boolean"
},
"result": {
"type": "number"
}
}
}
}
}
},
"output": {
"type": "object"
}
}
},
"project_gz": {
"type": "string",
"description": "Optional. Base64-encoded gzip of the project JSON, used as an alternative to inline `project` when the caller cannot fit the full payload in a single tool argument. Mutually exclusive with `project`. Model JSON typically compresses 5-10x."
}
}
},
"annotations": {
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true
}
}Fetch a worked-example Ptally project for a common line of business. Each example is a small, fully valid project with realistic collection tables, calculations, exclusions and refers, plus an embedded tests[] suite for reference. Use as a template — copy and adapt rather than authoring from scratch. Pass no arguments (or `list: true`) to get the catalog.
| Parameter | Type | Description |
|---|---|---|
| list | boolean | When true (or when type is omitted), return the catalog of available examples with their descriptions instead of a single project. |
| type | string | Which starter example to return. |
{
"name": "get_starter",
"title": "Example models",
"description": "Fetch a worked-example Ptally project for a common line of business. Each example is a small, fully valid project with realistic collection tables, calculations, exclusions and refers, plus an embedded tests[] suite for reference. Use as a template — copy and adapt rather than authoring from scratch. Pass no arguments (or `list: true`) to get the catalog.",
"inputSchema": {
"type": "object",
"properties": {
"list": {
"type": "boolean",
"description": "When true (or when type is omitted), return the catalog of available examples with their descriptions instead of a single project."
},
"type": {
"enum": [
"bop",
"commercial-auto",
"commercial-property",
"earthquake",
"equipment-breakdown",
"general-liability",
"home",
"inland-marine",
"management-liability",
"motor",
"travel",
"workers-comp"
],
"type": "string",
"description": "Which starter example to return."
}
}
},
"annotations": {
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true
}
}List every project stored on this self-host instance. Returns `{ count, projects: [{ project_reference, name, description }] }`. Descriptions are truncated to 100 characters so the response stays compact — call get_project for the full record. Archived projects are excluded.
No parameters.
{
"name": "get_projects",
"title": "List projects",
"description": "List every project stored on this self-host instance. Returns `{ count, projects: [{ project_reference, name, description }] }`. Descriptions are truncated to 100 characters so the response stays compact — call get_project for the full record. Archived projects are excluded.",
"inputSchema": {
"type": "object",
"properties": {}
},
"annotations": {
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true
}
}Fetch a project by `project_reference` from the self-host store. Optional `version_reference` pins to a specific version of that project (a version from another project is a tool error); otherwise the latest live (published or approved) version is used, or the latest non-archived version of any status if none is live. Returns `{ project_reference, version_reference, version, name, description, status, summary, created_at, updated_at, project_url, version_url, latest_draft, clipped_collections, documents, next_steps, model }`. `documents` lists the indexed project documents that apply to this version (`[{ document_reference, title, pages }]`) — search them with search_docs. The model is a summary for reading, never a file to hand back. Every `collection` step is stamped with `__context` (`total_rows`, `shown_rows`, `columns`, `shape`, `truncated`, `patchable`; an empty table gets `total_rows: 0`, `columns: []`, `patchable: true`): tables of up to 100 rows are shown whole and can be changed with patch_version; bigger ones are clipped, listed in `clipped_collections`, and can only change by the user downloading the model from `version_url`, you amending it, and the user uploading it. `latest_draft` is the newest draft version (null if none) — patches go there, so call get_project again with its version_reference before patching. Follow `next_steps` and tell the user which route applies before making changes. All other model content — input.format, steps, expressions, output — is returned verbatim so an LLM caller can understand what the project does and how to build a valid input payload. Precursor to run_quote and patch_version.
| Parameter | Type | Description |
|---|---|---|
| project_reference * | string | UUID of the project to fetch. |
| version_reference | string | Optional. Specific version UUID of this project; defaults to the latest live version, or the latest non-archived version of any status if none are live. |
List quotes stored on this self-host instance, newest first (`direction: "asc"` for oldest first). Filter by `project_reference` (from get_projects), `version_reference`, `journey_reference` (exact; the caller's own case id, shared by every quote in one journey, so `direction: "asc"` shows how that case changed over time), `since` (ISO date) or `search` (text match on indicator, quote_reference or journey_reference). Paged with `limit` (default 25, max 100) and `offset`; `has_more` says whether another page exists. Returns `{ count, limit, offset, has_more, quotes: [{ quote_reference, project_reference, project_name, version_reference, version, created_at, status, valid, result, indicator, journey_reference, exec_time_ms, error, amended_result, amended_valid, sold, quoted_by, source, quote_url }], next_steps }` — `quoted_by` (`{ user_reference, email, role }` or null) is who ran the quote and `source` how (api | mcp); `result` and `valid` are what the model returned; `amended_result` / `amended_valid` (null when not amended) are what someone changed them to in the dashboard, and `sold` (null when never set) whether it sold. No input or output payloads; call get_quote for one quote's full review. Dry runs (run_quote without save, run_version_tests) are never stored, so they never appear here; run_quote with save: true does.
| Parameter | Type | Description |
|---|---|---|
| limit | integer | Optional. Page size, default 25, max 100. |
| since | string | Optional. ISO date or date-time; only quotes created at or after it. |
| offset | integer | Optional. Rows to skip, for paging. |
| search | string | Optional. Text to match in the quote's indicator, quote_reference or journey_reference. |
| direction | string | Optional. desc (newest first, default) or asc. |
List journeys stored on this self-host instance. A journey is a collection of quote snapshots that build up to a complete sold (bound) journey: every quote saved with the same `journey_reference` (any string unique to the journey, e.g. an application or state-machine id) is a snapshot of the case at that point. The journey is complete when its latest quote is `sold`; until then it is in progress. One row per journey_reference, most recently active first. Each row is the journey's latest quote in the get_quotes shape (`result`, `valid`, `amended_result`, `amended_valid`, `sold`, …) plus `start_date` and `end_date` (its first and last quote's created_at), `lights` (the latest quote's module traffic lights, e.g. `{ check: "green", validate: "red" }`: any red means the case is stopped, any amber that it is referred), `quote_count`, `quotes` (`[{ quote_reference, created_at, quoted_by, source }]`, oldest first: who — a person, an AI agent or an integration — ran each snapshot, and through api or mcp) and `journey_url` (the dashboard's view of it). Quotes saved without a journey_reference belong to no journey. Filter by `project_reference` (only that project's quotes count), `since` (ISO date; journeys with a quote since then) or `search` (text match on journey_reference). Paged with `limit` (default 25, max 100) and `offset`; `has_more` says whether another page exists. Returns `{ count, limit, offset, has_more, journeys: [...], next_steps }`. Call get_journey for one journey's quotes in full.
| Parameter | Type | Description |
|---|---|---|
| limit | integer | Optional. Page size, default 25, max 100. |
| since | string | Optional. ISO date or date-time; only journeys with a quote at or after it. |
| offset | integer | Optional. Rows to skip, for paging. |
| search | string | Optional. Text to match in the journey_reference. |
| project_reference |
Every quote snapshot in one journey, oldest first, in the get_quotes shape. A journey is a collection of quote snapshots, all saved with one `journey_reference`, that build up to a complete sold (bound) journey; it is complete when its latest quote is `sold`. Returns `{ journey_reference, start_date, end_date, quote_count, limit, offset, has_more, quotes: [{ quote_reference, project_reference, project_name, version_reference, version, created_at, status, valid, result, indicator, journey_reference, exec_time_ms, error, amended_result, amended_valid, sold, quoted_by, source, quote_url }], journey_url, next_steps }`. `quoted_by` (`{ user_reference, email, role }`, or null) is who ran each quote — each stage can be completed by someone different (a person, an AI agent, an integration) — and `source` how (api | mcp). `actions` is the journey's history from the actions table, oldest first: `[{ type (quoted | price_changed | validity_changed | sold | unsold), quote_reference, created_at, by: { email, role }, via (api | mcp | dashboard), from, to, note }]` — who completed each stage and who re-priced or bound it. The last quote is where the case stands now (`sold` true means the journey is complete); compare `result` and `valid` from one quote to the next to explain what changed, and call get_quote with a quote_reference for one quote's full review (inputs, rules that fired, how the result was reached). Paged with `limit` (default and max 100) and `offset`. A journey_reference with no quotes is a tool error.
| Parameter | Type | Description |
|---|---|---|
| limit | integer | Optional. Page size, default and max 100. |
| offset | integer | Optional. Quotes to skip from the start of the journey, for paging. |
| journey_reference * | string | The journey's journey_reference (exact match), from get_journeys or a quote's journey_reference. |
Review one quote in a standard shape, from a stored `quote_reference` (get_quotes) or a pasted `quote` — the dashboard's Copy JSON, a POST /quotes or run_quote response, or a bare engine output with `debug` (`quote_gz`: base64 gzip of the same JSON, for big pastes). Pass exactly one. Returns `{ source, quote_reference, project_reference, project_name, version_reference, version, created_at, quoted_by, quoted_via, outcome: { decision (quoted | declined | referred | error), result, valid, status, error, exec_time_ms, engine_time_ms, steps, slowest_steps }, input, output, rules: { exclusions, refers, excesses, endorsements: { fired_count, checked_count, fired: [{ step, name, exp, values, result }] } }, result_build: { formula, values, result }, valid_rule: { exp, values, result }, build: [{ order, id, name, type, description, ms, logic: [{ name, exp | formula, values, result }], lookups, table_rows, output, errors }], errors, has_trace, truncated, amendment, quote_url, version_url, replay, how_to_explain, next_steps }`. `outcome` is always what the model returned. `amendment` (stored quotes only; null when never touched) is `{ result, valid, sold, amended_at, log: [{ when, who, via (dashboard | api | mcp), result: { from, to }, valid, sold, note }] }`: the result, validity or sold flag someone set afterwards (dashboard, API or amend_quote), and the log of who changed what. Step names, types, descriptions and collection lookups come from the version's model when it is on this instance. A quote without a step trace is re-run against its version (`replay: true` forces it); `replay` reports the replayed vs stored result and whether they match. Nothing is saved. Responses are kept under ~80 KB: large quotes come back clipped or as an overview (`truncated` says which) — pass `steps: [<id>, …]` for those steps in full. If even the overview is too big the result is `{ too_large: true, outcome, rules counts, next_steps }`: review a few steps at a time, or ask the user to paste the part they want explained. Explain the result back following `how_to_explain`.
| Parameter | Type | Description |
|---|---|---|
| quote | object | A pasted quote: the dashboard's Copy JSON, a POST /quotes or run_quote response, or an engine output with `debug`. A JSON string is also accepted. |
| steps | array |
Amend a SAVED quote (a quote_reference from get_quotes): its `result`, and optionally `valid` or `sold`, with a required `reason`. Logged in the quote's audit trail under the signed-in user, with the time, the old and new values, source "mcp" and the reason. The engine's own result, valid and output are never changed — the amended values sit beside them, and setting the result or validity back to the model's value clears that amendment (still logged). BEFORE CALLING 1. Call get_quote (or get_quotes) for the quote's current result, validity and sold flag. 2. Tell the user exactly what will change (old → new) and the reason that will be logged, and get their go-ahead. RULES - At least one of result, valid, sold, and each must differ from what the quote is now (else an error says nothing changed). - result is a number; valid and sold are booleans; reason is a non-empty sentence. - A sold quote is locked. The only change it accepts is `sold: false` on its own (marking it unsold, with a reason); after that it can be amended and marked sold again — three calls, each logged. Check get_quote first, and tell the user when a change means unselling the quote. A result change can go in the same call that marks it sold. - Refused in read-only mode. RESULT { quote_reference, engine: { result, valid }, now: { result, valid, sold }, amended, logged: { amendment_reference, by, at, source, result: { from, to }, valid, sold, reason }, quote_url, next_steps }.
| Parameter | Type | Description |
|---|---|---|
| sold | boolean | Optional. true marks it sold and locks it (a result change can go in the same call). false, sent on its own, marks a sold quote unsold so it can be changed. |
| valid | boolean | Optional. Whether the quote is now valid. Only on a quote that isn't sold. |
| reason * | string | Required on every call: why the result (or validity, or sale) is changing, in the user's words, e.g. "Quote amendment: agreed 5% discount". Logged with the change, who made it and when. |
| result | number |
Run a quote against a stored project: a dry run by default, saved only with `save: true`. Takes `project_reference`, an optional `version_reference` (defaults to the latest live version; there is no fallback to drafts, so pass `version_reference` to run one — it must belong to the project and not be archived, else a tool error), and an `input` payload that matches the project's input schema. Runs the model and returns the quote envelope — `output`, `result`, `valid`, `status`, `error`, the engine's `errors` log, `exec_time_ms`, `dry_run: true`, a null `quote_reference`, and `documents` (the indexed project documents for the version that ran $1, `[{ document_reference, title, pages }]`, to answer questions about cover with search_docs) — WITHOUT persisting a quotes row. With `save: true` the quote is stored like a POST /quotes, under the signed-in user (an engine error is stored as an error quote), and the envelope carries `dry_run: false`, its `quote_reference`, `created_at` and `quote_url`; it then shows in get_quotes and the dashboard and can be amended with amend_quote. Only save when the user asks for the quote to be kept, not to try inputs. Saving is refused in read-only mode. Call get_project first to inspect `input.format` and build a valid input.
| Parameter | Type | Description |
|---|---|---|
| save | boolean | Optional, default false (dry run, nothing stored). true stores the quote under the signed-in user and returns its quote_reference. Only when the user asks for the quote to be kept. |
| input * | object | Flat quote input object matching the project's input.format schema. Use get_project to discover the required keys. |
| source | string | Optional engine `source` label passed through to the model. Defaults to "mcp". |
| journey_reference | string | Optional. Any string unique to one journey (e.g. an application id), saved on the quote (with save: true). A journey is a collection of quote snapshots that build up to a complete sold (bound) journey: send the same journey_reference on every quote in it so get_journey shows how it built up; without… |
Run every test in a version's tests[] against that version's stored model and compare each with its expected output. Takes `version_reference` (any status but archived — a draft after patch_version, or a live version for a baseline). Runs against the stored model, so a patch saved a moment ago is included. A test passes when its result is within 0.005 of the expected result and its valid flag equals the expected valid. Expectations are read from output { result, valid }, or, when output has neither (tests imported from the hosted service), from result { result, valid }; `expected_from` says which. A test with neither is run but unchecked (passed: null). Returns `{ project_reference, version_reference, version, status, updated_at, total, passed, failed, unchecked, results: [{ id, name, passed, expected: { result, valid }, expected_from, actual: { result, valid }, problems, errors }], version_url, next_steps }` — `problems` says why a test failed, `errors` is up to 5 of the engine's step errors for that run. Nothing is persisted. Use after patch_version, after adding or changing tests, or before a change to record the baseline. To change a test's expected output, patch_version on /tests/<test id>/output/result (drafts only) — output takes precedence over result.
| Parameter | Type | Description |
|---|---|---|
| version_reference * | string | UUID of the version whose tests to run — e.g. get_project's latest_draft.version_reference, or the version_reference patch_version returned. |
{
"name": "run_version_tests",
"title": "Run a version's tests",
"description": "Run every test in a version's tests[] against that version's stored model and compare each with its expected output. Takes `version_reference` (any status but archived — a draft after patch_version, or a live version for a baseline). Runs against the stored model, so a patch saved a moment ago is included. A test passes when its result is within 0.005 of the expected result and its valid flag equals the expected valid. Expectations are read from output { result, valid }, or, when output has neither (tests imported from the hosted service), from result { result, valid }; `expected_from` says which. A test with neither is run but unchecked (passed: null). Returns `{ project_reference, version_reference, version, status, updated_at, total, passed, failed, unchecked, results: [{ id, name, passed, expected: { result, valid }, expected_from, actual: { result, valid }, problems, errors }], version_url, next_steps }` — `problems` says why a test failed, `errors` is up to 5 of the engine's step errors for that run. Nothing is persisted. Use after patch_version, after adding or changing tests, or before a change to record the baseline. To change a test's expected output, patch_version on /tests/<test id>/output/result (drafts only) — output takes precedence over result.",
"inputSchema": {
"type": "object",
"required": [
"version_reference"
],
"properties": {
"version_reference": {
"type": "string",
"description": "UUID of the version whose tests to run — e.g. get_project's latest_draft.version_reference, or the version_reference patch_version returned."
}
}
},
"annotations": {
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true
}
}Change a DRAFT version's stored model with an RFC 6902 JSON Patch, merged on the server. Use it for targeted edits; any change to a clipped collection (__context.patchable: false) goes through download and upload instead (see next_steps in get_project). BEFORE CALLING 1. The version must be a draft: use get_project's latest_draft. If it is null, ask the user to click New Version on the project page (it copies the live model), then call get_project again. 2. Call get_project with the draft's version_reference and build every path from that response. Pass its updated_at as base_updated_at. 3. Tell the user what you will change (old → new) and get their go-ahead. PATHS (JSON Pointer) - Name steps, tests and other id'd array elements by id (else key) instead of index: /steps/<step id>/... and /tests/<test id>/... Ids survive other steps being inserted or removed in the same patch. - Model layout: /meta/..., /input/format/<input key>/... (format is an object keyed by input key), /steps/<id>/..., /output/format/<key>/..., /tests/<id>/... - Collection rows by index. Compressed collection ([[col1, col2, ...], [v1, v2, ...], ...]): index 0 is the header row, so the first data row is /collection/1, and a cell is /collection/<row>/<column index>. Uncompressed collection (array of row objects): the first row is /collection/0, and a cell is /collection/<row>/<column name>. Check __context.shape and __context.columns. - Append with "-" (/steps/-, /steps/<id>/collection/-). Insert at a numeric index; step order is execution order, so a new step goes after the steps whose outputs it reads. - Escape "~" as ~0 and "/" as ~1 inside a segment. EXAMPLES - Change a rate cell: {"op":"replace","path":"/steps/region_rates/collection/1/1","value":4.5} - Guard then change: [{"op":"test","path":"/steps/base_premium/formula","value":"<current formula>"},{"op":"replace","path":"/steps/base_premium/formula","value":"<new formula>"}] - Add a table row: {"op":"add","path":"/steps/type_factors/collection/-","value":["gravel",1.1]} - Change an input default: {"op":"replace","path":"/input/format/bike_value/def","value":2000} - Insert a step as the 5th: {"op":"add","path":"/steps/4","value":{ ...full step object... }} - Update a test's expected result: {"op":"replace","path":"/tests/t01/output/result","value":46.1} - Add a test: {"op":"add","path":"/tests/-","value":{"id":"young_rider","name":"Young rider","key":"young_rider","input":{ ...every input key... },"output":{"result":52.5,"valid":true}}}. Expectations go in output { result, valid }, even if older tests on the model keep them under result. RULES - Smallest change: replace a field, not a whole step; never the whole model (path "" is refused). - New or replaced steps follow the config constraints in the server instructions (retain: true on transforms, unique id = key, {{}} references, ...). - Don't send __context (it's stripped anyway). A clipped collection must stay exactly as stored — no edits, no removal, no replacement with the sample you saw. A patched collection may hold at most 100 rows. - All operations apply or none do. At most 200 per call. RESULT { saved, updated_at, validation, tests: { total, passed, failed, unchecked, failures: [{ test, problems }] }, version_url, next_steps }. saved: false = schema validation failed, nothing stored — fix from validation.errors and retry. A conflict error = the draft changed since you read it — call get_project again and rebuild. Tests are run after saving and don't block it: report failures and ask whether their expected outputs should change. For every test's actual vs expected values, call run_version_tests. For another patch, use the returned updated_at. Never approves or publishes — the user does that in the UI.
List the documents uploaded to a project (policy wordings, product guides, underwriting guidelines or anything else), newest first, with their indexing status. Takes `project_reference` and optional `version_reference` (only documents that apply to that version: those for every version plus any pinned to it; without it, every document on the project). Returns `{ project_reference, version_reference, count, indexed, pending, failed, documents: [{ document_reference, title, filename, status, error, pages, chunk_count, bytes, version_reference, created_at }], next_steps }`. `status` is `indexed` (searchable with search_docs), `pending` or `indexing` (not searchable yet), or `failed` (with the reason in `error`, e.g. a scanned PDF with no text). `chunk_count` is how many searchable passages the document has. Documents are uploaded and deleted in the dashboard, not over MCP. Nothing is changed.
| Parameter | Type | Description |
|---|---|---|
| project_reference * | string | UUID of the project whose documents to list (get_projects lists projects). |
| version_reference | string | Optional. Only the documents that apply to this version of the project. |
{
"name": "list_docs",
"title": "List project documents",
"description": "List the documents uploaded to a project (policy wordings, product guides, underwriting guidelines or anything else), newest first, with their indexing status. Takes `project_reference` and optional `version_reference` (only documents that apply to that version: those for every version plus any pinned to it; without it, every document on the project). Returns `{ project_reference, version_reference, count, indexed, pending, failed, documents: [{ document_reference, title, filename, status, error, pages, chunk_count, bytes, version_reference, created_at }], next_steps }`. `status` is `indexed` (searchable with search_docs), `pending` or `indexing` (not searchable yet), or `failed` (with the reason in `error`, e.g. a scanned PDF with no text). `chunk_count` is how many searchable passages the document has. Documents are uploaded and deleted in the dashboard, not over MCP. Nothing is changed.",
"inputSchema": {
"type": "object",
"required": [
"project_reference"
],
"properties": {
"project_reference": {
"type": "string",
"description": "UUID of the project whose documents to list (get_projects lists projects)."
},
"version_reference": {
"type": "string",
"description": "Optional. Only the documents that apply to this version of the project."
}
}
},
"annotations": {
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true
}
}Search the documents uploaded to a project (policy wordings, product guides, underwriting guidelines or anything else) for the passages that answer a question about the product: what is covered or excluded, excesses, conditions, definitions, claims notice, eligibility. Takes `project_reference`, `query` (the question in plain words, or an exact term like "Section 4" or a defined term), optional `version_reference` (default: the latest live version, else the latest of any status; pass the version that ran $1 so the wording matches it), optional `k` (passages to return, default 5, max 20) and optional `document_references` to search only some documents. Every passage is scored by meaning (a local embedding model) and by keywords, blended 70/30. Returns `{ project_reference, version_reference, query, documents: { indexed, pending, failed }, results: [{ document_reference, title, filename, version_reference, chunk, page, section, text, score, similarity, keyword }], next_steps }`. `score` is relative to this search (the best passage scores near 1); `similarity` is the cosine similarity to the question (below about 0.5 is rarely relevant). Answer only from the returned text, citing title, section and page; read around a passage with get_doc. Nothing is changed.
| Parameter | Type | Description |
|---|---|---|
| k | integer | Optional. How many passages to return, default 5, max 20. |
| query * | string | The question, in plain words (e.g. "is flood damage to a basement covered"), or an exact term to find (a clause number, a defined term). |
| project_reference * | string | UUID of the project whose documents to search. |
| version_reference | string | Optional. The version whose documents to search: documents for every version plus any pinned to this one. Defaults to the latest live version. |
Read consecutive passages of an indexed document: the passage numbered `chunk` (a search_docs result's chunk) plus `before` and `after` passages either side (default 1 each, max 10). Use it when a search hit is cut off mid-clause, refers to another clause, or uses a defined term you need to read. Returns `{ document: { document_reference, title, filename, pages, chunk_count, status, … }, from, to, chunks: [{ chunk, page, section, text }] }`. chunk 0 with a larger `after` reads a document from the start. A document that isn't indexed yet is a tool error. Nothing is changed.
| Parameter | Type | Description |
|---|---|---|
| after | integer | Optional. Passages after it to include, default 1. |
| chunk | integer | Optional. The passage to read around: a search_docs result's chunk. Default 0 (the start). |
| before | integer | Optional. Passages before it to include, default 1. |
| document_reference * | string | The document, from a search_docs result or get_project's documents. |
{
"name": "get_doc",
"title": "Read a project document",
"description": "Read consecutive passages of an indexed document: the passage numbered `chunk` (a search_docs result's chunk) plus `before` and `after` passages either side (default 1 each, max 10). Use it when a search hit is cut off mid-clause, refers to another clause, or uses a defined term you need to read. Returns `{ document: { document_reference, title, filename, pages, chunk_count, status, … }, from, to, chunks: [{ chunk, page, section, text }] }`. chunk 0 with a larger `after` reads a document from the start. A document that isn't indexed yet is a tool error. Nothing is changed.",
"inputSchema": {
"type": "object",
"required": [
"document_reference"
],
"properties": {
"after": {
"type": "integer",
"maximum": 10,
"minimum": 0,
"description": "Optional. Passages after it to include, default 1."
},
"chunk": {
"type": "integer",
"minimum": 0,
"description": "Optional. The passage to read around: a search_docs result's chunk. Default 0 (the start)."
},
"before": {
"type": "integer",
"maximum": 10,
"minimum": 0,
"description": "Optional. Passages before it to include, default 1."
},
"document_reference": {
"type": "string",
"description": "The document, from a search_docs result or get_project's documents."
}
}
},
"annotations": {
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true
}
}Diagnostic snapshot of the deployed MCP server plus a live probe of its store (sqlite or Postgres). Returns server name and version, protocol version, root, boot time, advertised tool names and count, a hash of the tool surface, and `store` — `{ ok, latency_ms, counts: { projects, quotes } }` from counting rows in the projects table (one row per version) and the quotes table, or `{ ok: false, latency_ms, error }`.
No parameters.
{
"name": "get_health",
"title": "Health check",
"description": "Diagnostic snapshot of the deployed MCP server plus a live probe of its store (sqlite or Postgres). Returns server name and version, protocol version, root, boot time, advertised tool names and count, a hash of the tool surface, and `store` — `{ ok, latency_ms, counts: { projects, quotes } }` from counting rows in the projects table (one row per version) and the quotes table, or `{ ok: false, latency_ms, error }`.",
"inputSchema": {
"type": "object",
"properties": {}
},
"annotations": {
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true
}
}**ENVIRONMENT: SELF-HOST — root https://app.ptally.ai** You are connected to a self-hosted Ptally MCP server. Only three things change anything: patch_version (a draft version's model; approving and publishing stay with the user in the UI), amend_quote (a saved quote's result, validity or sold flag, logged with who, when and why) and run_quote with save: true (stores the quote under the user). Every other quote run through MCP (run_quote by default, run_version_tests, get_quote replays) is a dry run that is never saved; get_quotes, get_quote, get_journeys and get_journey read the saved quotes. Concepts — use these words with the user: - Model: a project's decision flow for one product or process (checks, validation, enrichment, KYC, rating, routing). A rater or rules engine is one or more steps inside it, not the whole model. A model used as a step inside another model is a module. - Quote: one run of a model for one case at a point in time — its result (the model's headline number: a premium, an income, a score…), whether it is valid, any refers or exclusions, and its outputs. - Journey: a collection of quote snapshots, saved with the same journey_reference, that build up to a complete sold (bound) journey. - Sold: the journey's accepted, bound, final quote; the journey is finished. Flow: a model runs → each run is a quote → quotes for one case form a journey → the journey ends when a quote is sold. Don't assume a result is a price: check what the project's output and description say it is. get_projects, get_project, get_quotes, get_quote, get_journeys, get_journey, amend_quote, run_quote, run_version_tests, patch_version, list_docs, search_docs and get_doc require sign-in: an OAuth bearer (the connector handles it automatically), or, for agent and service accounts and clients that take a single API key (such as Copilot Studio), the keys as one x-api-key: <client_id_key>:<client_secret_key> header — the default way agents connect. The reference tools and get_health are open. Never ask the user to paste client_id_key / client_secret_key into the chat. Agent and service accounts can read and run quotes (including run_quote with save: true) but not amend quotes or edit versions. Use it to: - Learn the rules and reference for building a Ptally model (get_docs). - Fetch the project JSON schema (get_schema). - Validate an inline project config against the schema (validate_project). - Fetch a worked-example starter project for a common line of business (get_starter). - List projects stored on this self-host instance (get_projects). - Fetch a stored project with collection rows sampled (get_project). - List stored quotes, filtered by project or version (get_quotes). - List journeys (get_journeys) and read one oldest first (get_journey). A journey is a collection of quote snapshots, all saved with the same journey_reference, that build up to a complete sold (bound) journey: it is complete when its latest quote is sold, and in progress until then. - Review one quote — stored or pasted — step by step: timings, each step's output, the rules that fired, how the result was reached (get_quote). - Amend a saved quote's result (or validity, or sold) with a reason, logged under the user (amend_quote). - Run a quote against a stored project: a dry run by default, or saved with save: true (run_quote). - Run every test on a version and compare with the expected outputs (run_version_tests). - Edit a draft version by merging a JSON Patch into its stored model (patch_version). - List a project's documents (policy wordings, product guides, underwriting guidelines and anything else uploaded to it), with their indexing status (list_docs). - Answer questions about a product from its project documents (search_docs, get_doc). - Probe server + local store health (get_health). Recommended authoring loop for a new project: 1. Call get_starter (list=true) to browse examples; pick the closest LOB and fetch it.
Names, descriptions and schemas were written by the server and are shown as data.
Pattern matches on what the server declares. They show what it says it can do, not what it does.
None yet. Changes appear after a server's second daily check.
{
"name": "get_project",
"title": "See a project",
"description": "Fetch a project by `project_reference` from the self-host store. Optional `version_reference` pins to a specific version of that project (a version from another project is a tool error); otherwise the latest live (published or approved) version is used, or the latest non-archived version of any status if none is live. Returns `{ project_reference, version_reference, version, name, description, status, summary, created_at, updated_at, project_url, version_url, latest_draft, clipped_collections, documents, next_steps, model }`. `documents` lists the indexed project documents that apply to this version (`[{ document_reference, title, pages }]`) — search them with search_docs. The model is a summary for reading, never a file to hand back. Every `collection` step is stamped with `__context` (`total_rows`, `shown_rows`, `columns`, `shape`, `truncated`, `patchable`; an empty table gets `total_rows: 0`, `columns: []`, `patchable: true`): tables of up to 100 rows are shown whole and can be changed with patch_version; bigger ones are clipped, listed in `clipped_collections`, and can only change by the user downloading the model from `version_url`, you amending it, and the user uploading it. `latest_draft` is the newest draft version (null if none) — patches go there, so call get_project again with its version_reference before patching. Follow `next_steps` and tell the user which route applies before making changes. All other model content — input.format, steps, expressions, output — is returned verbatim so an LLM caller can understand what the project does and how to build a valid input payload. Precursor to run_quote and patch_version.",
"inputSchema": {
"type": "object",
"required": [
"project_reference"
],
"properties": {
"project_reference": {
"type": "string",
"description": "UUID of the project to fetch."
},
"version_reference": {
"type": "string",
"description": "Optional. Specific version UUID of this project; defaults to the latest live version, or the latest non-archived version of any status if none are live."
}
}
},
"annotations": {
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true
}
}| journey_reference | string | Optional. Only quotes saved with this journey_reference (exact match). A journey_reference is the caller's own id for one case, repeated on every quote in its journey, so with direction "asc" this reads as how the case changed over time. |
| project_reference | string | Optional. Only quotes for this project (get_projects lists them). |
| version_reference | string | Optional. Only quotes run by this version. |
{
"name": "get_quotes",
"title": "List quotes",
"description": "List quotes stored on this self-host instance, newest first (`direction: \"asc\"` for oldest first). Filter by `project_reference` (from get_projects), `version_reference`, `journey_reference` (exact; the caller's own case id, shared by every quote in one journey, so `direction: \"asc\"` shows how that case changed over time), `since` (ISO date) or `search` (text match on indicator, quote_reference or journey_reference). Paged with `limit` (default 25, max 100) and `offset`; `has_more` says whether another page exists. Returns `{ count, limit, offset, has_more, quotes: [{ quote_reference, project_reference, project_name, version_reference, version, created_at, status, valid, result, indicator, journey_reference, exec_time_ms, error, amended_result, amended_valid, sold, quoted_by, source, quote_url }], next_steps }` — `quoted_by` (`{ user_reference, email, role }` or null) is who ran the quote and `source` how (api | mcp); `result` and `valid` are what the model returned; `amended_result` / `amended_valid` (null when not amended) are what someone changed them to in the dashboard, and `sold` (null when never set) whether it sold. No input or output payloads; call get_quote for one quote's full review. Dry runs (run_quote without save, run_version_tests) are never stored, so they never appear here; run_quote with save: true does.",
"inputSchema": {
"type": "object",
"properties": {
"limit": {
"type": "integer",
"maximum": 100,
"minimum": 1,
"description": "Optional. Page size, default 25, max 100."
},
"since": {
"type": "string",
"description": "Optional. ISO date or date-time; only quotes created at or after it."
},
"offset": {
"type": "integer",
"minimum": 0,
"description": "Optional. Rows to skip, for paging."
},
"search": {
"type": "string",
"description": "Optional. Text to match in the quote's indicator, quote_reference or journey_reference."
},
"direction": {
"enum": [
"desc",
"asc"
],
"type": "string",
"description": "Optional. desc (newest first, default) or asc."
},
"journey_reference": {
"type": "string",
"description": "Optional. Only quotes saved with this journey_reference (exact match). A journey_reference is the caller's own id for one case, repeated on every quote in its journey, so with direction \"asc\" this reads as how the case changed over time."
},
"project_reference": {
"type": "string",
"description": "Optional. Only quotes for this project (get_projects lists them)."
},
"version_reference": {
"type": "string",
"description": "Optional. Only quotes run by this version."
}
}
},
"annotations": {
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true
}
}| string |
| Optional. Only this project's quotes (get_projects lists them). |
{
"name": "get_journeys",
"title": "List journeys",
"description": "List journeys stored on this self-host instance. A journey is a collection of quote snapshots that build up to a complete sold (bound) journey: every quote saved with the same `journey_reference` (any string unique to the journey, e.g. an application or state-machine id) is a snapshot of the case at that point. The journey is complete when its latest quote is `sold`; until then it is in progress. One row per journey_reference, most recently active first. Each row is the journey's latest quote in the get_quotes shape (`result`, `valid`, `amended_result`, `amended_valid`, `sold`, …) plus `start_date` and `end_date` (its first and last quote's created_at), `lights` (the latest quote's module traffic lights, e.g. `{ check: \"green\", validate: \"red\" }`: any red means the case is stopped, any amber that it is referred), `quote_count`, `quotes` (`[{ quote_reference, created_at, quoted_by, source }]`, oldest first: who — a person, an AI agent or an integration — ran each snapshot, and through api or mcp) and `journey_url` (the dashboard's view of it). Quotes saved without a journey_reference belong to no journey. Filter by `project_reference` (only that project's quotes count), `since` (ISO date; journeys with a quote since then) or `search` (text match on journey_reference). Paged with `limit` (default 25, max 100) and `offset`; `has_more` says whether another page exists. Returns `{ count, limit, offset, has_more, journeys: [...], next_steps }`. Call get_journey for one journey's quotes in full.",
"inputSchema": {
"type": "object",
"properties": {
"limit": {
"type": "integer",
"maximum": 100,
"minimum": 1,
"description": "Optional. Page size, default 25, max 100."
},
"since": {
"type": "string",
"description": "Optional. ISO date or date-time; only journeys with a quote at or after it."
},
"offset": {
"type": "integer",
"minimum": 0,
"description": "Optional. Rows to skip, for paging."
},
"search": {
"type": "string",
"description": "Optional. Text to match in the journey_reference."
},
"project_reference": {
"type": "string",
"description": "Optional. Only this project's quotes (get_projects lists them)."
}
}
},
"annotations": {
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true
}
}{
"name": "get_journey",
"title": "Read a journey",
"description": "Every quote snapshot in one journey, oldest first, in the get_quotes shape. A journey is a collection of quote snapshots, all saved with one `journey_reference`, that build up to a complete sold (bound) journey; it is complete when its latest quote is `sold`. Returns `{ journey_reference, start_date, end_date, quote_count, limit, offset, has_more, quotes: [{ quote_reference, project_reference, project_name, version_reference, version, created_at, status, valid, result, indicator, journey_reference, exec_time_ms, error, amended_result, amended_valid, sold, quoted_by, source, quote_url }], journey_url, next_steps }`. `quoted_by` (`{ user_reference, email, role }`, or null) is who ran each quote — each stage can be completed by someone different (a person, an AI agent, an integration) — and `source` how (api | mcp). `actions` is the journey's history from the actions table, oldest first: `[{ type (quoted | price_changed | validity_changed | sold | unsold), quote_reference, created_at, by: { email, role }, via (api | mcp | dashboard), from, to, note }]` — who completed each stage and who re-priced or bound it. The last quote is where the case stands now (`sold` true means the journey is complete); compare `result` and `valid` from one quote to the next to explain what changed, and call get_quote with a quote_reference for one quote's full review (inputs, rules that fired, how the result was reached). Paged with `limit` (default and max 100) and `offset`. A journey_reference with no quotes is a tool error.",
"inputSchema": {
"type": "object",
"required": [
"journey_reference"
],
"properties": {
"limit": {
"type": "integer",
"maximum": 100,
"minimum": 1,
"description": "Optional. Page size, default and max 100."
},
"offset": {
"type": "integer",
"minimum": 0,
"description": "Optional. Quotes to skip from the start of the journey, for paging."
},
"journey_reference": {
"type": "string",
"description": "The journey's journey_reference (exact match), from get_journeys or a quote's journey_reference."
}
}
},
"annotations": {
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true
}
}| Optional. Step ids to return in full (and only those in `build`). Use after a truncated review, or to focus on one step. |
| replay | boolean | Optional. Re-run the quote's input against its version even when it has a step trace, and compare with the stored result. Never saved. |
| quote_gz | string | Base64-encoded gzip of the quote JSON, instead of `quote` when it is too big to pass inline. |
| quote_reference | string | A stored quote's reference, from get_quotes. |
{
"name": "get_quote",
"title": "Review a quote",
"description": "Review one quote in a standard shape, from a stored `quote_reference` (get_quotes) or a pasted `quote` — the dashboard's Copy JSON, a POST /quotes or run_quote response, or a bare engine output with `debug` (`quote_gz`: base64 gzip of the same JSON, for big pastes). Pass exactly one. Returns `{ source, quote_reference, project_reference, project_name, version_reference, version, created_at, quoted_by, quoted_via, outcome: { decision (quoted | declined | referred | error), result, valid, status, error, exec_time_ms, engine_time_ms, steps, slowest_steps }, input, output, rules: { exclusions, refers, excesses, endorsements: { fired_count, checked_count, fired: [{ step, name, exp, values, result }] } }, result_build: { formula, values, result }, valid_rule: { exp, values, result }, build: [{ order, id, name, type, description, ms, logic: [{ name, exp | formula, values, result }], lookups, table_rows, output, errors }], errors, has_trace, truncated, amendment, quote_url, version_url, replay, how_to_explain, next_steps }`. `outcome` is always what the model returned. `amendment` (stored quotes only; null when never touched) is `{ result, valid, sold, amended_at, log: [{ when, who, via (dashboard | api | mcp), result: { from, to }, valid, sold, note }] }`: the result, validity or sold flag someone set afterwards (dashboard, API or amend_quote), and the log of who changed what. Step names, types, descriptions and collection lookups come from the version's model when it is on this instance. A quote without a step trace is re-run against its version (`replay: true` forces it); `replay` reports the replayed vs stored result and whether they match. Nothing is saved. Responses are kept under ~80 KB: large quotes come back clipped or as an overview (`truncated` says which) — pass `steps: [<id>, …]` for those steps in full. If even the overview is too big the result is `{ too_large: true, outcome, rules counts, next_steps }`: review a few steps at a time, or ask the user to paste the part they want explained. Explain the result back following `how_to_explain`.",
"inputSchema": {
"type": "object",
"properties": {
"quote": {
"type": "object",
"description": "A pasted quote: the dashboard's Copy JSON, a POST /quotes or run_quote response, or an engine output with `debug`. A JSON string is also accepted."
},
"steps": {
"type": "array",
"items": {
"type": "string"
},
"description": "Optional. Step ids to return in full (and only those in `build`). Use after a truncated review, or to focus on one step."
},
"replay": {
"type": "boolean",
"description": "Optional. Re-run the quote's input against its version even when it has a step trace, and compare with the stored result. Never saved."
},
"quote_gz": {
"type": "string",
"description": "Base64-encoded gzip of the quote JSON, instead of `quote` when it is too big to pass inline."
},
"quote_reference": {
"type": "string",
"description": "A stored quote's reference, from get_quotes."
}
}
},
"annotations": {
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true
}
}| The new result. Only on a quote that isn't sold — mark a sold quote unsold first. |
| quote_reference * | string | The saved quote to amend, from get_quotes. |
{
"name": "amend_quote",
"title": "Amend a quote",
"description": "Amend a SAVED quote (a quote_reference from get_quotes): its `result`, and optionally `valid` or `sold`, with a required `reason`. Logged in the quote's audit trail under the signed-in user, with the time, the old and new values, source \"mcp\" and the reason. The engine's own result, valid and output are never changed — the amended values sit beside them, and setting the result or validity back to the model's value clears that amendment (still logged).\n\nBEFORE CALLING\n1. Call get_quote (or get_quotes) for the quote's current result, validity and sold flag.\n2. Tell the user exactly what will change (old → new) and the reason that will be logged, and get their go-ahead.\n\nRULES\n- At least one of result, valid, sold, and each must differ from what the quote is now (else an error says nothing changed).\n- result is a number; valid and sold are booleans; reason is a non-empty sentence.\n- A sold quote is locked. The only change it accepts is `sold: false` on its own (marking it unsold, with a reason); after that it can be amended and marked sold again — three calls, each logged. Check get_quote first, and tell the user when a change means unselling the quote. A result change can go in the same call that marks it sold.\n- Refused in read-only mode.\n\nRESULT\n{ quote_reference, engine: { result, valid }, now: { result, valid, sold }, amended, logged: { amendment_reference, by, at, source, result: { from, to }, valid, sold, reason }, quote_url, next_steps }.",
"inputSchema": {
"type": "object",
"required": [
"quote_reference",
"reason"
],
"properties": {
"sold": {
"type": "boolean",
"description": "Optional. true marks it sold and locks it (a result change can go in the same call). false, sent on its own, marks a sold quote unsold so it can be changed."
},
"valid": {
"type": "boolean",
"description": "Optional. Whether the quote is now valid. Only on a quote that isn't sold."
},
"reason": {
"type": "string",
"description": "Required on every call: why the result (or validity, or sale) is changing, in the user's words, e.g. \"Quote amendment: agreed 5% discount\". Logged with the change, who made it and when."
},
"result": {
"type": "number",
"description": "The new result. Only on a quote that isn't sold — mark a sold quote unsold first."
},
"quote_reference": {
"type": "string",
"description": "The saved quote to amend, from get_quotes."
}
}
},
"annotations": {
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": false,
"destructiveHint": false
}
}| project_reference * | string | UUID of the project to run against. |
| version_reference | string | Optional. Specific non-archived version UUID of this project; defaults to the latest live version (no fallback to drafts). |
{
"name": "run_quote",
"title": "Try a quote",
"description": "Run a quote against a stored project: a dry run by default, saved only with `save: true`. Takes `project_reference`, an optional `version_reference` (defaults to the latest live version; there is no fallback to drafts, so pass `version_reference` to run one — it must belong to the project and not be archived, else a tool error), and an `input` payload that matches the project's input schema. Runs the model and returns the quote envelope — `output`, `result`, `valid`, `status`, `error`, the engine's `errors` log, `exec_time_ms`, `dry_run: true`, a null `quote_reference`, and `documents` (the indexed project documents for the version that ran $1, `[{ document_reference, title, pages }]`, to answer questions about cover with search_docs) — WITHOUT persisting a quotes row. With `save: true` the quote is stored like a POST /quotes, under the signed-in user (an engine error is stored as an error quote), and the envelope carries `dry_run: false`, its `quote_reference`, `created_at` and `quote_url`; it then shows in get_quotes and the dashboard and can be amended with amend_quote. Only save when the user asks for the quote to be kept, not to try inputs. Saving is refused in read-only mode. Call get_project first to inspect `input.format` and build a valid input.",
"inputSchema": {
"type": "object",
"required": [
"project_reference",
"input"
],
"properties": {
"save": {
"type": "boolean",
"description": "Optional, default false (dry run, nothing stored). true stores the quote under the signed-in user and returns its quote_reference. Only when the user asks for the quote to be kept."
},
"input": {
"type": "object",
"description": "Flat quote input object matching the project's input.format schema. Use get_project to discover the required keys."
},
"source": {
"type": "string",
"description": "Optional engine `source` label passed through to the model. Defaults to \"mcp\"."
},
"journey_reference": {
"type": "string",
"description": "Optional. Any string unique to one journey (e.g. an application id), saved on the quote (with save: true). A journey is a collection of quote snapshots that build up to a complete sold (bound) journey: send the same journey_reference on every quote in it so get_journey shows how it built up; without one the quote is in no journey. Overrides a journey_reference inside input."
},
"project_reference": {
"type": "string",
"description": "UUID of the project to run against."
},
"version_reference": {
"type": "string",
"description": "Optional. Specific non-archived version UUID of this project; defaults to the latest live version (no fallback to drafts)."
}
}
},
"annotations": {
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": false,
"destructiveHint": false
}
}| Parameter | Type | Description |
|---|---|---|
| operations * | array | RFC 6902 JSON Patch operations, applied in order to the full stored model, all or nothing. At most 200. |
| base_updated_at * | string | The draft's updated_at exactly as get_project (called with this version_reference) or the previous patch returned it. A mismatch means someone changed the draft since — the patch is refused. |
| version_reference * | string | UUID of the draft version to patch: get_project's latest_draft.version_reference. Never a published or approved version. |
{
"name": "patch_version",
"title": "Edit a draft",
"description": "Change a DRAFT version's stored model with an RFC 6902 JSON Patch, merged on the server. Use it for targeted edits; any change to a clipped collection (__context.patchable: false) goes through download and upload instead (see next_steps in get_project).\n\nBEFORE CALLING\n1. The version must be a draft: use get_project's latest_draft. If it is null, ask the user to click New Version on the project page (it copies the live model), then call get_project again.\n2. Call get_project with the draft's version_reference and build every path from that response. Pass its updated_at as base_updated_at.\n3. Tell the user what you will change (old → new) and get their go-ahead.\n\nPATHS (JSON Pointer)\n- Name steps, tests and other id'd array elements by id (else key) instead of index: /steps/<step id>/... and /tests/<test id>/... Ids survive other steps being inserted or removed in the same patch.\n- Model layout: /meta/..., /input/format/<input key>/... (format is an object keyed by input key), /steps/<id>/..., /output/format/<key>/..., /tests/<id>/...\n- Collection rows by index. Compressed collection ([[col1, col2, ...], [v1, v2, ...], ...]): index 0 is the header row, so the first data row is /collection/1, and a cell is /collection/<row>/<column index>. Uncompressed collection (array of row objects): the first row is /collection/0, and a cell is /collection/<row>/<column name>. Check __context.shape and __context.columns.\n- Append with \"-\" (/steps/-, /steps/<id>/collection/-). Insert at a numeric index; step order is execution order, so a new step goes after the steps whose outputs it reads.\n- Escape \"~\" as ~0 and \"/\" as ~1 inside a segment.\n\nEXAMPLES\n- Change a rate cell: {\"op\":\"replace\",\"path\":\"/steps/region_rates/collection/1/1\",\"value\":4.5}\n- Guard then change: [{\"op\":\"test\",\"path\":\"/steps/base_premium/formula\",\"value\":\"<current formula>\"},{\"op\":\"replace\",\"path\":\"/steps/base_premium/formula\",\"value\":\"<new formula>\"}]\n- Add a table row: {\"op\":\"add\",\"path\":\"/steps/type_factors/collection/-\",\"value\":[\"gravel\",1.1]}\n- Change an input default: {\"op\":\"replace\",\"path\":\"/input/format/bike_value/def\",\"value\":2000}\n- Insert a step as the 5th: {\"op\":\"add\",\"path\":\"/steps/4\",\"value\":{ ...full step object... }}\n- Update a test's expected result: {\"op\":\"replace\",\"path\":\"/tests/t01/output/result\",\"value\":46.1}\n- Add a test: {\"op\":\"add\",\"path\":\"/tests/-\",\"value\":{\"id\":\"young_rider\",\"name\":\"Young rider\",\"key\":\"young_rider\",\"input\":{ ...every input key... },\"output\":{\"result\":52.5,\"valid\":true}}}. Expectations go in output { result, valid }, even if older tests on the model keep them under result.\n\nRULES\n- Smallest change: replace a field, not a whole step; never the whole model (path \"\" is refused).\n- New or replaced steps follow the config constraints in the server instructions (retain: true on transforms, unique id = key, {{}} references, ...).\n- Don't send __context (it's stripped anyway). A clipped collection must stay exactly as stored — no edits, no removal, no replacement with the sample you saw. A patched collection may hold at most 100 rows.\n- All operations apply or none do. At most 200 per call.\n\nRESULT\n{ saved, updated_at, validation, tests: { total, passed, failed, unchecked, failures: [{ test, problems }] }, version_url, next_steps }. saved: false = schema validation failed, nothing stored — fix from validation.errors and retry. A conflict error = the draft changed since you read it — call get_project again and rebuild. Tests are run after saving and don't block it: report failures and ask whether their expected outputs should change. For every test's actual vs expected values, call run_version_tests. For another patch, use the returned updated_at. Never approves or publishes — the user does that in the UI.",
"inputSchema": {
"type": "object",
"required": [
"version_reference",
"base_updated_at",
"operations"
],
"properties": {
"operations": {
"type": "array",
"items": {
"type": "object",
"required": [
"op",
"path"
],
"properties": {
"op": {
"enum": [
"add",
"remove",
"replace",
"move",
"copy",
"test"
],
"type": "string",
"description": "test fails the whole patch unless the value at path equals value — use it to guard a change."
},
"from": {
"type": "string",
"description": "Source pointer for move and copy."
},
"path": {
"type": "string",
"description": "JSON Pointer into the model, e.g. /steps/<step id>/formula or /steps/<step id>/collection/1/1. Array elements by id (else key) or index; \"-\" appends."
},
"value": {
"description": "New value for add, replace and test: any JSON (a number, string, row array, row object or whole step)."
}
}
},
"description": "RFC 6902 JSON Patch operations, applied in order to the full stored model, all or nothing. At most 200."
},
"base_updated_at": {
"type": "string",
"description": "The draft's updated_at exactly as get_project (called with this version_reference) or the previous patch returned it. A mismatch means someone changed the draft since — the patch is refused."
},
"version_reference": {
"type": "string",
"description": "UUID of the draft version to patch: get_project's latest_draft.version_reference. Never a published or approved version."
}
}
},
"annotations": {
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": false,
"destructiveHint": false
}
}| document_references | array | Optional. Only search these documents (from get_project's or run_quote's documents). |
{
"name": "search_docs",
"title": "Search project documents",
"description": "Search the documents uploaded to a project (policy wordings, product guides, underwriting guidelines or anything else) for the passages that answer a question about the product: what is covered or excluded, excesses, conditions, definitions, claims notice, eligibility. Takes `project_reference`, `query` (the question in plain words, or an exact term like \"Section 4\" or a defined term), optional `version_reference` (default: the latest live version, else the latest of any status; pass the version that ran $1 so the wording matches it), optional `k` (passages to return, default 5, max 20) and optional `document_references` to search only some documents. Every passage is scored by meaning (a local embedding model) and by keywords, blended 70/30. Returns `{ project_reference, version_reference, query, documents: { indexed, pending, failed }, results: [{ document_reference, title, filename, version_reference, chunk, page, section, text, score, similarity, keyword }], next_steps }`. `score` is relative to this search (the best passage scores near 1); `similarity` is the cosine similarity to the question (below about 0.5 is rarely relevant). Answer only from the returned text, citing title, section and page; read around a passage with get_doc. Nothing is changed.",
"inputSchema": {
"type": "object",
"required": [
"project_reference",
"query"
],
"properties": {
"k": {
"type": "integer",
"maximum": 20,
"minimum": 1,
"description": "Optional. How many passages to return, default 5, max 20."
},
"query": {
"type": "string",
"description": "The question, in plain words (e.g. \"is flood damage to a basement covered\"), or an exact term to find (a clause number, a defined term)."
},
"project_reference": {
"type": "string",
"description": "UUID of the project whose documents to search."
},
"version_reference": {
"type": "string",
"description": "Optional. The version whose documents to search: documents for every version plus any pinned to this one. Defaults to the latest live version."
},
"document_references": {
"type": "array",
"items": {
"type": "string"
},
"description": "Optional. Only search these documents (from get_project's or run_quote's documents)."
}
}
},
"annotations": {
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true
}
}