All workflows

Check drafts against your style guide before they publish

Reads drafts marked ready in your Notion content calendar, checks each against your style rules with Jev, and flags the ones that fail.

Outcome

  • A table of each draft with every rule it passed or failed and Jev's probability for each.

  • Each draft's status set to passed or needs edits in Notion, with its failed rules in its style-checks property.

  • A Slack post listing the drafts that need edits and why.

How it works

  1. 1

    Find the calendar

    Notion

    Search for calendar. Keep its data source ID and the names of its status and author properties.

  2. 2

    Find the drafts

    Notion

    Query the calendar for pages whose status is ready_status. Keep each page's ID, title and author.

  3. 3

    Read them

    Notion

    Keep each draft's text.

  4. 4

    Check every rule

    TypeSafe AI

    Send each draft's title and text as the state, with one noul per line of rules, asking whether the draft meets it. Keep each rule's probability: a rule passes when its answer is yes and fails when it is no.

  5. 5

    Point to the problems

    Your agent

    Show the user the rules whose answer is unsure, and keep what the user decides. For each failed rule, find the sentence in the draft that breaks it, and show the user the drafts, their failed rules and those sentences.

  6. 6

    Update the calendar

    Notion

    After the user approves, set each draft's status to passed_status or failed_status, write its failed rules and sentences in checks_property in under 2,000 characters, and clear checks_property on the drafts that pass.

  7. 7

    Tell the writers

    Slack

    Post the drafts that need edits to writers_channel with their authors and failed rules.

You'll be asked for

  • The Notion content calendar database, by name

    e.g. Content calendar

  • The status that marks a draft ready for review

    e.g. Ready for review

  • Your style rules, one line each

    e.g. Every claim with a number links its source; The headline promises only what the body delivers; No more than one call to action; No competitor is named in a negative way

  • The status a draft moves to when it passes every rule

    e.g. Approved

  • The status a draft moves to when it fails one

    e.g. Needs edits

  • The text property that lists a draft's failed rules, created once

    e.g. Style checks

  • How sure Jev must be before its answer is used without you

    e.g. 0.8; a yes-or-no answer counts as yes at or above it and as no at or below 1 minus it

  • The Slack channel the writers watch

    e.g. #content

The file your agent runs

draft-style-check.md

Check drafts against your style guide before they publish

Reads drafts marked ready in your Notion content calendar, checks each against your style rules with Jev, and flags the ones that fail.

Set up the tools below, then run the steps in order for the user, carrying each step's results into the next. The run is done when the user has the outcome below.

Outcome

  • A table of each draft with every rule it passed or failed and Jev's probability for each.
  • Each draft's status set to passed or needs edits in Notion, with its failed rules in its style-checks property.
  • A Slack post listing the drafts that need edits and why.

Inputs

Ask the user for these before you start.

  • calendar: the Notion content calendar database, by name, e.g. Content calendar
  • ready_status: the status that marks a draft ready for review, e.g. Ready for review
  • rules: your style rules, one line each, e.g. Every claim with a number links its source; The headline promises only what the body delivers; No more than one call to action; No competitor is named in a negative way
  • passed_status: the status a draft moves to when it passes every rule, e.g. Approved
  • failed_status: the status a draft moves to when it fails one, e.g. Needs edits
  • checks_property: the text property that lists a draft's failed rules, created once, e.g. Style checks
  • min_confidence: how sure Jev must be before its answer is used without you, e.g. 0.8; a yes-or-no answer counts as yes at or above it and as no at or below 1 minus it
  • writers_channel: the Slack channel the writers watch, e.g. #content

Set up

Notion (tool:notion/search-workspace, tool:notion/query-data-source, tool:notion/read-page, tool:notion/update-page)

For each call, use the first option your agent supports that lists it.

Notes:

  • Search the workspace: Over the API, matches only the titles of pages and data sources the token can reach; notion-search on the MCP server also searches page content.
  • Query a data source: Over MCP, SQL is unlimited only on Business and Enterprise plans with Notion AI; on other plans, rows mode and single-data-source SQL share a per-workspace allowance.
MCP (official, remote)

Add this server to your agent's MCP settings, then sign in when asked.

{ "mcpServers": { "notion": { "url": "https://mcp.notion.com/mcp" } } }
  • Search the workspace: call the MCP tool notion-search
  • Query a data source: call the MCP tool notion-query-data-sources
  • Read a page: call the MCP tool notion-fetch
  • Update a page: call the MCP tool notion-update-page
CLI (official)

Install the command, then confirm it runs.

npm install --global ntn
ntn --version
  • Search the workspace: run ntn api v1/search
  • Query a data source: run ntn datasources query <data-source-id>
  • Update a page: run ntn api v1/pages/$PAGE_ID -X PATCH

Set $NOTION_API_TOKEN in your environment first (get a key: https://www.notion.so/developers/tokens).

API (official)

Answer typed questions (TypeSafe AI, tool:typesafe/answer-typed-questions)

Use the API.

Note: Put every question about one record in one request. GET /v1/models lists the models and is the cheapest check of a key; a request over the rate limit gets a 429 with a Retry-After header.

Note: Send state, model (jev-latest) and named questions, each with type, instructions and criteria: a choice maps labels to descriptions, a score lists its levels in order, a noul's is optional. Read a score by its most likely level; send unsure answers to a person.

Post a message (Slack, tool:slack/post-message)

Use the first option your agent supports.

Note: Needs the chat:write scope. Over MCP it posts as the signed-in user; the API and CLI post as the app's bot.

MCP (official, remote)

Add this server to your agent's MCP settings, then sign in when asked.

{ "mcpServers": { "slack": { "url": "https://mcp.slack.com/mcp" } } }

Call the MCP tool slack_send_message.

CLI (official)

Install the command, then confirm it runs.

curl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bash
slack --version

Run slack api chat.postMessage.

Set $SLACK_BOT_TOKEN in your environment first (get a key: https://api.slack.com/apps).

Before step 1, confirm access to each service with its cheapest read-only call, like a list or a search. Never send or change anything to test access.

Steps

  1. Find the calendar with Search the workspace (Notion). Search for calendar. Keep its data source ID and the names of its status and author properties.
  2. Find the drafts with Query a data source (Notion). Query the calendar for pages whose status is ready_status. Keep each page's ID, title and author.
  3. Read them with Read a page (Notion). Keep each draft's text.
  4. Check every rule with Answer typed questions (TypeSafe AI). Send each draft's title and text as the state, with one noul per line of rules, asking whether the draft meets it. Keep each rule's probability: a rule passes when its answer is yes and fails when it is no.
  5. Point to the problems yourself. Show the user the rules whose answer is unsure, and keep what the user decides. For each failed rule, find the sentence in the draft that breaks it, and show the user the drafts, their failed rules and those sentences.
  6. Update the calendar with Update a page (Notion). After the user approves, set each draft's status to passed_status or failed_status, write its failed rules and sentences in checks_property in under 2,000 characters, and clear checks_property on the drafts that pass.
  7. Tell the writers with Post a message (Slack). Post the drafts that need edits to writers_channel with their authors and failed rules.

Notes

One yes-or-no question per rule keeps each check narrow, and all of a draft's rules go in one request, so adding a rule adds little time or cost. Write each rule as something a careful editor could judge in a second; a rule like "sounds on-brand" is too vague to check.

Jev checks; it does not rewrite. The writer, or an agent you trust, fixes the sentences step 5 points to, and the draft goes back to ready_status for another pass.

Rules

  • Use only the services set up above. The read-only calls they need, like listing ids or polling for results, are fine.
  • Ask the user before anything that sends messages, costs money, or changes data, and say how many records it touches. One approval covers a batch the user has seen.
  • Never print API keys.