Normalize sloppy model-generated Markdown to one house style, leaving code untouched

$0.005 USDC per call · Agent infrastructure · POST /api/v1/markdown-syntax-shaper · Id markdown-syntax-shaper

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

FieldTypeRequiredDescription
markdownstring; length 1..100000yesMarkdown to normalize.
bulletstring; one of "-", "*", "+"noMarker for unordered lists. Default '-'.
fixHeadingSpacebooleannoRestore the space in '##Title'. A lowercase '#tag' at level 1 is treated as a hashtag and left alone. Default true.
stripTrailingWhitespacebooleannoDefault true; a two-space hard break before more paragraph text is kept.
collapseBlankLinesbooleannoCollapse runs of blank lines and drop leading and trailing blanks. Default true.
blankLinesAroundBlocksbooleannoInsert a blank line around headings and top-level fenced blocks. Default true.
closeUnclosedFencebooleannoAppend the closing fence when the document ends inside one. Default true.
finalNewlinebooleannoEnd 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.

FieldTypeRequiredDescription
statusstring; one of "pass", "fail", "unknown", "unsupported"nopass: 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.
markdownstringnoThe shaped Markdown, with the input's line-ending style (CRLF if the input used it).
changeCountintegerno
countsobjectno
changesarray<object>; max 200 itemsnoFirst 200 edits.
advisoriesarray<object>; max 200 itemsno
witnessesarray<object>no
versionsobjectnoEvery semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile).
limitsarray<string>no
deterministicbooleannoAlways 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