{"id":"480da48d-27c6-42de-971a-0fefa82f7a0c","slug":"ruleverdict","kind":"mcp","name":"ruleverdict","summary":"Deterministic rule-engine decisions with document-grounded explanations, rules and usage tools.","owner":"CloudCorpRecords","repoUrl":"https://github.com/CloudCorpRecords/ruleverdict","license":"MIT","licenseTier":"permissive","trust":"community","stars":0,"match":null,"fewStars":true,"format":"mcp","createdAt":"2026-11-03T19:33:24.000Z","addedAt":"2026-11-05T20:06:06.599Z","logoUrl":"https://avatars.githubusercontent.com/u/95189389?u=8e277e1a24ff84ae7b49c89e6897fa44178a5c34&v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["files-documents"],"tags":[],"runtime":"node","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-11-05T22:05:03.820Z","sample":false,"url":"https://conduits.dev/tools/ruleverdict","language":"TypeScript","transports":["stdio"],"install":{"npm":"@reneturcios/ruleverdict"},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"# ruleverdict\n\nAsk a rule engine, not a guess. ruleverdict is a small\nclient for the ai-rete-rag service, which decides cases\nwith deterministic rules instead of free-form model\noutput: you pass structured facts and/or free text for a\ndomain, and the verdict comes from that domain's rule\nset, explained with the documents the rules rest on.\n\nAlongside deciding, it covers the full life of a domain:\nsee which facts the rules need, inspect the rules\nthemselves, pull them down as editable YAML, draft new\nrules from a written policy (each draft cites the\nsentence it encodes, and nothing is saved until you say\nso), publish a replacement rule set, feed policy text\ninto the knowledge base, and watch the monthly decision\nquota. Responses come back exactly as the service\nreturned them: nothing is trimmed, renamed or summarised\non the way through.\n\n## Configuration\n\nTwo environment variables control the client:\n\n- `AI_RETE_RAG_API_KEY` (optional) — when set, it is sent\n  on every request as `Authorization: Bearer <key>`.\n  Leaving it unset is not an error: shared demo domains\n  work keyless, and enforcement problems such as a\n  missing domain claim or an exhausted quota surface from\n  the API as errors rather than failing locally.\n- `AI_RETE_RAG_API_URL` (optional) — API base URL.\n  Defaults to `https://ai-rete-rag.com` (see \"Endpoint\n  provenance\" below).\n\n## Tools\n\n- `decide` — make a decision in a domain from structured\n  `facts` and/or free `text`; the verdict comes from the\n  rule engine, with a document-grounded explanation.\n  Optional: `as_of` (a date the decision is evaluated\n  at), `fact_sources` (where each fact came from), and\n  the retrieval-mode flags `pattern_01` (Pattern 01:\n  rules-scope retrieval) and `pattern_02` (Pattern 02:\n  retrieval into working memory). Typical call:\n  `decide(domain=\"loan\", facts={...})`.\n- `get_parameters` — the facts a domain's rules decide\n  on, most decisive first: what to collect before\n  calling `decide`.\n- `list_rules` — inspect a domain's rules: conditions,\n  verdicts, salience and overlaps.\n- `get_rule_source` — fetch a domain's rule set as\n  editable YAML.\n- `import_policy_rules` — turn a written policy document\n  into draft rules, each citing the sentence it encodes.\n  Nothing is saved.\n- `put_rules` — create or replace a domain's rule set\n  from YAML; pass `dry_run` to validate without saving.\n- `ingest_text` — add policy text to a domain's\n  knowledge base, optionally with `effective_from` /\n  `effective_until` dates or a `supersedes` pointer to\n  the version it replaces.\n- `list_documents` — browse a domain's ingested\n  documents.\n- `get_usage` — check your plan and remaining monthly\n  decision quota.\n\nUnset optional arguments are omitted from requests\nentirely. An upstream non-2xx reply fails with\n`ai-rete-rag error: HTTP <status>` and an unreachable API\nwith `ai-rete-rag unreachable`.\n\n### Endpoint provenance\n\nThe original project's README pins the nine tools, the\nworked `decide` example, the Pattern 01 / Pattern 02\nmodes, both environment variable names, the optional-key\nbehaviour, and the dry-run / nothing-saved workflow\nsemantics — but not the request paths. Those are\nreconstructions, labelled as such:\n\n- `POST <base>/api/decide` with the arguments as the JSON\n  body (used by `decide`).\n- `GET <base>/api/domains/{domain}/parameters` (used by\n  `get_parameters`).\n- `GET <base>/api/domains/{domain}/rules` (used by\n  `list_rules`).\n- `GET <base>/api/domains/{domain}/rules/source` (used\n  by `get_rule_source`).\n- `POST <base>/api/domains/{domain}/rules/import` with\n  body `{\"text\": \"...\"}` (used by\n  `import_policy_rules`).\n- `PUT <base>/api/domains/{domain}/rules` with body\n  `{\"rules\": \"...\", \"dry_run\": ...}` (used by\n  `put_rules`).\n- `POST <base>/api/domains/{domain}/documents` with body\n  `{\"text\": \"...\", ...}` (used by `ingest_text`).\n- `GET <base>/api/domains/{domain}/documents` (used by\n  `list_documents`).\n- `GET <base>/api/usage` (used by `get_usage`).\n\nDomain path segments are URL-encoded.\n\n## CLI\n\nEach tool is a subcommand taking one JSON argument\nstring:\n\n```bash\nnpx @reneturcios/ruleverdict decide '{\"domain\":\"loan\",\"facts\":{\"income\":85000}}'\nnpx @reneturcios/ruleverdict get_parameters '{\"domain\":\"loan\"}'\nnpx @reneturcios/ruleverdict list_rules '{\"domain\":\"loan\"}'\nnpx @reneturcios/ruleverdict get_rule_source '{\"domain\":\"loan\"}'\nnpx @reneturcios/ruleverdict import_policy_rules '{\"domain\":\"loan\",\"text\":\"Loans need verified income.\"}'\nnpx @reneturcios/ruleverdict put_rules '{\"domain\":\"loan\",\"rules\":\"rules: []\",\"dry_run\":true}'\nnpx @reneturcios/ruleverdict ingest_text '{\"domain\":\"loan\",\"text\":\"Policy text\"}'\nnpx @reneturcios/ruleverdict list_documents '{\"domain\":\"loan\"}'\nnpx @reneturcios/ruleverdict get_usage '{}'\nnpx @reneturcios/ruleverdict --version\n```\n\nOutput is the tool's result text (the upstream body on\nsuccess). Exit codes: `0` on success, `1` on a runtime\nerror, `2` on a usage error.\n\n## MCP server\n\n```bash\nnpx -y @reneturcios/ruleverdict mcp\n```\n\nMCP client config (the key is optional; provide it\nthrough the client's environment when you have one):\n\n```json\n{\n  \"mcpServers\": {\n    \"ruleverdict\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@reneturcios/ruleverdict\", \"mcp\"],\n      \"env\": {\n        \"AI_RETE_RAG_API_KEY\": \"<your key>\"\n      }\n    }\n  }\n}\n```\n\n## Docker\n\n```bash\ndocker run -i ghcr.io/cloudcorprecords/ruleverdict\ndocker run --rm ghcr.io/cloudcorprecords/ruleverdict get_usage '{}'\n```\n\n## Development\n\n```bash\nnpm install\nnpm run build   # tsc -> dist/\nnpm test        # tsx --test test/*.test.ts (fake fetch only, no network)\nnpm run dev     # run the CLI from source\n```\n\n## License\n\nMIT — Copyright (c) 2026 Rene Turcios\n"}