You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Security:
- converter: h2-h6 headings (and any heading routed to the section.mrkdwn
fallback) now entity-escape < > & in the heading text. The fallback
previously escaped only emphasis markers, so `## <!channel>` in
rich_text mode emitted a live broadcast. handleFallback and the
blockquote unknown-child path were hardened the same way.
Added:
- server: block_kit_to_markdown tool (inverse conversion; lossy, warns)
- server: MCP tool annotations on all six tools
- server: block-kit-cheatsheet MCP resource + format_for_slack prompt
- validator: button/context/table/image-title/section-accessory rules
- validator: surface-aware validation (modal/home 100-block ceiling)
- converter: MaxNestingDepth guard (ErrInputTooDeeplyNested)
- internal/reverse package; block_kit re-exports the new surface
Changed:
- server: return_preview_url is a real opt-out (*bool)
- server: convert rejects unknown split values; non-loopback bind warning
- deps: slack-go/slack v0.23.0 -> v0.23.1
Fixed:
- splitter: SplitText no longer cuts inside a multi-byte UTF-8 rune
- converter: long-heading fallback truncation is rune-safe, no dangling \
ci: coverage gate now enforces >=80% per package, not just overall.
Copy file name to clipboardExpand all lines: README.md
+21-3Lines changed: 21 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,16 +22,22 @@
22
22
23
23
## What it does
24
24
25
-
Five MCP tools your AI assistant can call:
25
+
Six MCP tools your AI assistant can call:
26
26
27
27
| Tool | What it does |
28
28
|---|---|
29
-
|**`convert_markdown_to_block_kit`**| Markdown → Block Kit JSON. Auto mode picks between Slack's new (Feb 2025) `markdown` block and full deterministic decomposition into `rich_text` / `section` / `header` / `image` / `divider`. |
30
-
|**`validate_block_kit`**| Validates a payload against the documented Slack constraints (per-block char limits, count limits, XOR rules, `only_one_table_allowed`, the 12k-char `markdown_block` cap, etc.) with structured violations + fix hints. |
29
+
|**`convert_markdown_to_block_kit`**| Markdown → Block Kit JSON. Auto mode picks between Slack's new (Feb 2025) `markdown` block and full deterministic decomposition into `rich_text` / `section` / `header` / `image` / `divider` / `table`. |
30
+
|**`block_kit_to_markdown`**| The inverse — Block Kit JSON → Markdown. Best-effort and lossy; constructs with no Markdown equivalent (buttons, accessories, colors) are approximated and reported in `warnings`. |
31
+
|**`validate_block_kit`**| Validates a payload against the documented Slack constraints (per-block char limits, count limits, button/context/table element limits, XOR rules, `only_one_table_allowed`, the 12k-char `markdown_block` cap, etc.) with structured violations + fix hints. Pass `surface` (`message` / `modal` / `home`) to set the block ceiling. |
31
32
|**`preview_block_kit`**| Returns a Block Kit Builder URL — one click to a live visual preview in Slack's own builder. No workspace credentials needed. |
32
33
|**`lint_block_kit`**| Warns on near-limit content, deprecated patterns, and accessibility gaps (e.g. missing image `alt_text`). Always advisory. |
33
34
|**`split_blocks`**| Splits an oversized payload into multiple Slack-API-compliant chunks on the >50-block axis, with `only_one_table_allowed` enforcement. |
34
35
36
+
The server also exposes an MCP **resource** (`block-kit-cheatsheet` — the
37
+
conversion modes, supported Markdown, Slack limits, and mention-safety
38
+
model) and a **prompt** (`format_for_slack`) so MCP clients can discover
39
+
how to use the tools.
40
+
35
41
Plus a **`convert` CLI** for offline testing without an MCP client.
36
42
37
43
### Conversion modes
@@ -43,6 +49,18 @@ Plus a **`convert` CLI** for offline testing without an MCP client.
43
49
|**`auto`** (default) | One Slack `markdown` block when the input is short, image-free, and contains no nested-block patterns. Otherwise full `rich_text` decomposition. | Most LLM workflows — let the converter pick. |
44
50
|**`rich_text`**| Always full decomposition into typed `rich_text` / `section` / `header` / `image` / `divider` / `table` blocks. | When you want explicit, deterministic block shapes (e.g. for downstream styling, validation, or because you don't want to delegate rendering to Slack's `markdown` parser). |
45
51
|**`markdown_block`**| Single Slack `markdown` block — Slack's server-side parser owns the rendering. | When the input is known-good markdown and you want the smallest possible payload. Errors if input >12,000 chars. |
52
+
|**`section_mrkdwn`**|`section` blocks with `mrkdwn` text. | Downstream consumers that need the older `section`-based shape. |
0 commit comments