lens-mcp
v1.1.1Outside-in validation gate for AI-generated text; a separate model checks LLM output, fail-closed.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
validate_content Validate Content
Run the 10-lens validation gate on AI-generated content. Returns pass/fail, per-lens results, violation details, and a deterministic 0-10 score derived from violation counts (10 = clean, floors at 0; computed by the API tier layer, not by the LLM — the LLM-emitted 0-100 score was removed 2026-07-30). Requires SOULFIELD_API_KEY. Supports domains: general, finance, marketing, legal, seo, agency. WIRE CONTRACT (since 2026-08-10): each lens carries status (ran|skipped|error) and passed is null whenever no verdict was produced — parse passed===false as the violation signal, never !passed. HALT…
| Parameter | Type | Description |
|---|---|---|
text * | string | The AI-generated content to validate |
context | string | Audience/purpose context for Relevance lens (Lens 9). Omit to skip Relevance silently. |
domain | string | Domain context for validation (default: general) |
scrub_pii Scrub PII
Scan text for structured PII and secrets (emails, UK/US phone numbers, credit-card numbers, US SSNs, UK NI/UTR numbers, database connection strings, and common API-key/credential patterns) via the hosted Lens API. Returns scrubbed text with each match replaced by a generic [REDACTED] marker (the finding TYPE — email, phone_uk, ni_number, etc. — appears only in the findings list, not in the replacement), plus that findings list. It scrubs structured identifiers only: personal NAMES survive, so scrubbed output is not anonymized. Pattern-based server-side scan, no LLM call. Targets structured…
| Parameter | Type | Description |
|---|---|---|
text * | string | The text to scan for PII |
lens_health Lens API Health Check
Check if the Soulfield Lens API service is running and responsive. Returns status and version. No auth required.
lens_catches_relevant Prior Catches (institutional defect memory)
Read the defect bank BEFORE validating: prior named defects for an artifact type, most-recurrent patterns first. This is the institutional memory that makes the gate improve over time — the recurring traps tell you where this class of artifact has failed before. Any pattern at threshold is marked [PROMOTE], meaning it recurs often enough to deserve a deterministic check. Runs the local lens-kit CLI, no LLM call. Omit artifact_type and pass all=true when the type has no history yet.
| Parameter | Type | Description |
|---|---|---|
all | boolean | Surface every catch regardless of artifact type |
artifact_type | string | Artifact type to filter by, e.g. landing-copy, research-brief, content-pack |
cwd | string | Working directory to run in. catches.jsonl is read from and written to here. Defaults to the server's cwd. |
domain | string | Also filter by domain, e.g. marketing, finance, agency |
format | string | block = paste-ready surface (default); json = raw records |
threshold | integer | Recurrence threshold for [PROMOTE] lines (default 3) |
lens_catches_add Record a Catch (append to defect memory)
Append a NAMED DEFECT to the defect bank so it is caught next time. Record what was WRONG, the general pattern it is an instance of, and the forward rule that prevents it — doctrine REJECTS routine passes, so only log actual defects. Set self_catch=true when the defect was a failure of your own validation discipline. This is the write half of the improvement loop: enough recurrences of a pattern promote it to a deterministic check.
| Parameter | Type | Description |
|---|---|---|
artifact_type * | string | Artifact type, e.g. landing-copy, research-brief |
catch * | string | What was WRONG (the specific defect found) |
domain * | string | Domain, e.g. marketing, finance, agency |
pattern * | string | The general trap this is an instance of |
rule * | string | The forward rule that prevents this next time |
cwd | string | Working directory to run in. catches.jsonl is read from and written to here. Defaults to the server's cwd. |
self_catch | boolean | True if this was a failure of the validator's own discipline |
lens_catches_stats Catch Recurrence Stats
Per-pattern recurrence counts across the defect bank. Any pattern at or above the threshold gets a PROMOTE-to-deterministic-check suggestion — that is the signal a recurring judgment call should become a cheap fixed check instead. Use this to decide what to harden next.
| Parameter | Type | Description |
|---|---|---|
cwd | string | Working directory to run in. catches.jsonl is read from and written to here. Defaults to the server's cwd. |
lens_consistency_leaks Forbidden-String Leak Scan
Scan customer-facing files for deny-list terms (CASE-INSENSITIVE literal match — note lens_consistency_markers is case-SENSITIVE, they differ). Deterministic, no LLM. Exit 6 on a hit. Run this on EVERY customer-facing file before any irreversible publish: it is the check that catches a real client name, an internal codename or a banned absolute surviving into shipped copy. A credential scanner will not find these, because nothing here is a credential. IMPORTANT — a hit proves the STRING IS PRESENT, which is authoritative; it does not by itself prove a violation, because the match is NEGATI…
| Parameter | Type | Description |
|---|---|---|
files * | array | Local file path(s) to scan |
cwd | string | Working directory to run in. catches.jsonl is read from and written to here. Defaults to the server's cwd. |
deny | array | Extra deny terms, added to the profile's consistency.deny |
profile | string | Profile YAML providing consistency.deny |
lens_consistency_numbers Number Parity (summary vs body)
Check that every numeric literal in a summary actually appears in the body it summarizes. Deterministic, no LLM, exit 6 on a violation. Catches the invented figure — the number a summary asserts that its source never stated. TRIPWIRE, not an oracle: literal matching only, no semantic or derived arithmetic, so a legitimately computed total will flag. Review a hit, do not auto-trust it.
| Parameter | Type | Description |
|---|---|---|
body * | string | The body file the summary summarizes |
summary * | string | The summary file (its numbers must appear in the body) |
cwd | string | Working directory to run in. catches.jsonl is read from and written to here. Defaults to the server's cwd. |
lens_consistency_markers Marker Parity (source vs rendered)
Check that evidence markers counted in a source artifact survive into every rendered output. Deterministic, no LLM, exit 6 on a violation. Catches the caveat, citation or hedge that gets dropped between formats — the source says 'as-of 2026-04' and the rendered deck quietly does not. Matching is CASE-SENSITIVE (unlike lens_consistency_leaks, which is case-insensitive), so pick markers whose casing is stable across source and render: 'TRIPWIRE' in the source will NOT match 'Tripwire' in the render and will read as dropped when nothing was. TRIPWIRE: a deliberate subset render also under-count…
| Parameter | Type | Description |
|---|---|---|
rendered * | array | Rendered output file(s) to check against the source |
source * | string | The source artifact (authoritative marker counts) |
cwd | string | Working directory to run in. catches.jsonl is read from and written to here. Defaults to the server's cwd. |
markers | array | Explicit marker strings (otherwise taken from the profile) |
profile | string | Profile YAML providing the marker set |