# LexQ

LexQ is a rule engine with built-in simulation. Define, test, and deploy business rules without touching application code. 55 MCP tools for complete rule lifecycle management — from rule creation to …

## Quick Start

```bash
# Connect this server (installs CLI if needed)
npx -y @smithery/cli@latest mcp add lexq-io/lexq

# Browse available tools
npx -y @smithery/cli@latest tool list lexq-io/lexq

# Get full schema for a tool
npx -y @smithery/cli@latest tool get lexq-io/lexq lexq_whoami

# Call a tool
npx -y @smithery/cli@latest tool call lexq-io/lexq lexq_whoami '{}'
```

## Direct MCP Connection

Endpoint: `https://lexq--lexq-io.run.tools`

## Tools (55)

- `lexq_whoami` — Show current authentication info (tenant name, role, API key mask).
- `lexq_groups_list` — List all policy groups. Supports pagination and optional status/keyword filters.
- `lexq_groups_get` — Get a single policy group by ID.
- `lexq_groups_create` — Create a new policy group. Requires name and priority. Optionally set conflict resolution, activation group, and descri…
- `lexq_groups_update` — Update an existing policy group. Only provided fields are updated.
- `lexq_groups_delete` — Archive a policy group. Only non-live groups can be deleted. This is irreversible.
- `lexq_ab_test_start` — Start an A/B test on a policy group. Requires a challenger version ID and traffic split percentages.
- `lexq_ab_test_stop` — Stop a running A/B test. Specify which version to keep.
- `lexq_ab_test_adjust` — Adjust traffic weights of a running A/B test.
- `lexq_versions_list` — List all versions of a policy group.
- `lexq_versions_get` — Get a single version by ID, including its rules and fact requirements.
- `lexq_versions_create` — Create a new DRAFT version in a policy group. Provide a commit message and optional effective date range.
- `lexq_versions_update` — Update a DRAFT version. Only DRAFT versions can be modified.
- `lexq_versions_delete` — Delete a DRAFT version. Only DRAFT versions can be deleted.
- `lexq_versions_clone` — Clone an existing version to create a new DRAFT. Useful when the source version is already published.
- `lexq_rules_list` — List all rules in a version. Returns summary with conditionSummary and actionSummary.
- `lexq_rules_get` — Get full rule detail including condition tree and action definitions.
- `lexq_rules_create` — Create a rule in a DRAFT version. Requires name, priority, condition tree, and actions array.
- `lexq_rules_update` — Update an existing rule in a DRAFT version. Only provided fields are changed.
- `lexq_rules_delete` — Delete a rule from a DRAFT version.
- `lexq_rules_reorder` — Reorder rules by specifying rule IDs and their new priorities. Array index 0 = highest priority.
- `lexq_rules_toggle` — Enable or disable a rule without deleting it.
- `lexq_facts_list` — List all fact definitions (input variable schema). Shows key, type, and required status. Always check this before creat…
- `lexq_facts_create` — Register a new input variable. Key must be lowercase with underscores (e.g. payment_amount). Types: STRING, NUMBER, BOO…
- `lexq_facts_update` — Update a fact definition. Key and type cannot be changed. System facts only allow name and description changes.
- `lexq_facts_delete` — Delete a fact definition. System facts cannot be deleted.
- `lexq_deploy_publish` — Publish a DRAFT version (DRAFT → ACTIVE). Locks the version from further edits. Must have at least one rule.
- `lexq_deploy_live` — Deploy an ACTIVE (published) version to live traffic. Takes effect immediately.
- `lexq_deploy_rollback` — Rollback to the previous deployed version. Only available if there is a previous version.
- `lexq_deploy_undeploy` — Remove the live version from traffic. The version stays ACTIVE but no longer serves requests.
- `lexq_deploy_history` — List deployment history across all groups.
- `lexq_deploy_detail` — Get detailed info about a specific deployment including snapshot hash and integrity check.
- `lexq_deploy_overview` — Show current deployment status of all groups — which version is live, last deployment type, and deployer.
- `lexq_dry_run` — Execute a single dry run against a version. Tests how rules evaluate given input facts without side effects.
- `lexq_dry_run_compare` — Compare dry run results between two versions using the same input facts. Useful for validating changes.
- `lexq_requirements` — Analyze which input facts a version requires. Returns required keys, types, and an example request body.
- `lexq_simulation_start` — Start a batch simulation against historical execution data.
- `lexq_simulation_status` — Get simulation status and results. Poll until status is COMPLETED or FAILED.
- `lexq_simulation_list` — List simulation history with optional filters.
- `lexq_simulation_cancel` — Cancel a running or pending simulation.
- `lexq_simulation_export` — Export simulation results as JSON or CSV. Returns the raw data.
- `lexq_dataset_upload` — Upload inline CSV or JSON content as a simulation dataset.
- `lexq_dataset_template` — Generate a sample CSV or JSON template based on the required facts of a version. Use this to understand the expected da…
- `lexq_history_list` — List policy execution history. Shows trace ID, group, version, status, match result, and latency.
- `lexq_history_get` — Get full execution detail including request facts, result traces, and decision traces.
- `lexq_history_stats` — Get execution KPIs: total executions, success/failure counts, success rate, and average latency.
- `lexq_integrations_list` — List all external integrations (webhooks, CRM, notification, etc.).
- `lexq_integrations_get` — Get integration detail by ID.
- `lexq_integrations_save` — Create or update an integration. Types: COUPON, POINT, NOTIFICATION, CRM, MESSENGER, WEBHOOK.
- `lexq_integrations_delete` — Delete an integration by ID.
- `lexq_integrations_config_spec` — Show available integration types and their required configuration fields.
- `lexq_logs_list` — List system failure logs from background tasks (webhook calls, coupon issuance, etc.).
- `lexq_logs_get` — Get failure log detail by ID.
- `lexq_logs_action` — Process a single failure log: RETRY, RESOLVE, or IGNORE.
- `lexq_logs_bulk_action` — Process multiple failure logs at once. Provide an array of log IDs and the action.

```bash
# Get full input/output schema for a tool
npx -y @smithery/cli@latest tool get lexq-io/lexq <tool-name>
```
