Normalize sloppy model-generated Markdown to one house style, leaving code untouched
Rewrites Markdown from a language model into a consistent style and reports each edit by line: restores the space in '##Title', converts '*', '+' and '•' bullets to your chosen marker, strips trailing whitespace (keeping two-space hard breaks), collapses runs of blank lines, puts blank lines around headings and fenced blocks, closes a fence left open at the end, and ends the file with one newline. Line-based, not a full parser: fenced and indented code are never edited, and raw HTML, tables, setext headings and nested-list indentation are left as they are. Heading level skips are reported, not changed. status is pass when the input already conformed and fail when edits were needed; the shaped text is returned either way.
What you get
Deterministic cleanup before publishing or diffing model output; no model call, 100,000 characters per $0.005.
Call it
Send the JSON body below to https://agents.writerslogic.com/api/v1/markdown-syntax-shaper. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.
curl -i -X POST https://agents.writerslogic.com/api/v1/markdown-syntax-shaper \
-H 'content-type: application/json' \
-d '{"markdown":"##Overview\nSome text \n* first\n• second\n\n\n\n```js\nconst x = 1; \n```\nAfter the code."}'
Input
| Field | Type | Required | Description |
|---|---|---|---|
markdown | string; length 1..100000 | yes | Markdown to normalize. |
bullet | string; one of "-", "*", "+" | no | Marker for unordered lists. Default '-'. |
fixHeadingSpace | boolean | no | Restore the space in '##Title'. A lowercase '#tag' at level 1 is treated as a hashtag and left alone. Default true. |
stripTrailingWhitespace | boolean | no | Default true; a two-space hard break before more paragraph text is kept. |
collapseBlankLines | boolean | no | Collapse runs of blank lines and drop leading and trailing blanks. Default true. |
blankLinesAroundBlocks | boolean | no | Insert a blank line around headings and top-level fenced blocks. Default true. |
closeUnclosedFence | boolean | no | Append the closing fence when the document ends inside one. Default true. |
finalNewline | boolean | no | End with exactly one newline. Default true. |
Example request body
{
"markdown": "##Overview\nSome text \n* first\n• second\n\n\n\n```js\nconst x = 1; \n```\nAfter the code."
}
Result
The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.
| Field | Type | Required | Description |
|---|---|---|---|
status | string; one of "pass", "fail", "unknown", "unsupported" | no | pass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass. |
markdown | string | no | The shaped Markdown, with the input's line-ending style (CRLF if the input used it). |
changeCount | integer | no | |
counts | object | no | |
changes | array<object>; max 200 items | no | First 200 edits. |
advisories | array<object>; max 200 items | no | |
witnesses | array<object> | no | |
versions | object | no | Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile). |
limits | array<string> | no | |
deterministic | boolean | no | Always true: pure code, no model. |
Pay and connect
Available through: x402 (USDC on Base), MCP. MCP clients reach it through the context-evidence-kit package.
Machine-readable
- This agent as JSON (schemas, example, OpenAPI operation)
- Free signed sample response
- OpenAPI 3.1 · Catalog · Index of every agent