Skip to content

App note format ​

An app note is markdown: a YAML frontmatter, then executable fenced blocks. Other content (headings, text, illustration code, ```output blocks) is ignored when the app runs.

Frontmatter ​

yaml
---
app: 1                               # required: format version
description: Log my Tempo time       # used by the search
when: ["log my time", "tempo"]       # phrasings that should find the app
params:
  date:    { type: string, format: date, default: "{{today}}" }
  days:    { type: integer, default: 30, description: "Minimum age" }
  country: { type: string, enum: [FR, DE, ES] }
presets:                             # shared sets of values
  germany-60d: { country: DE, days: 60 }
origin:                              # traceability, never executed
  prompt: "Which FR customers have unpaid invoices older than 30 days?"
  by: znote-ai
  date: 2026-11-23
---
Parameter attributePurpose
typestring, number, integer, boolean, array, object
defaultValue used when the field is left empty. Can use {{today}} or {{today:YYYY-MM}}
enumAllowed values (shown as a list)
formatdate for a date picker
descriptionHelp text of the field

A parameter without default is required as soon as a block that runs uses it. Values are resolved in this order: default, then the preset, then the values of the run.

Blocks ​

A block is a fence whose info line has a type and attributes:

md
```<type> name=<id> attr=value attr="with spaces"
AttributePurpose
name=Block id (a-z, digits, -, _). Without it, the block is block-<n>
from=a,bThe block reads the results of blocks a and b, which run before it
each=xRun the block once per item of x (a parameter or a block, each=missing.rows), with {{item}} and {{index}}
confirm=trueThe block writes: it never runs without confirmation
view=table|chart|kpi|json|textDisplay hint. Today the panel picks the display from the shape of the result

Blocks run in dependency order (from=, each=), otherwise in document order.

sql ​

A query through an MCP SQL server. :name parameters are replaced by escaped SQL literals: a string in quotes, a number, NULL, or a list for IN (:ids).

md
```sql mcp=shop_db dialect=postgres name=top-customers
SELECT name, total FROM customers
WHERE country = :country
ORDER BY total DESC
LIMIT :limit
```

dialect=mysql|mariadb|postgres|sqlite|ansi tells how the database reads a backslash in a string. Without dialect=, a text value that contains \ is refused.

mcp ​

A direct call to an MCP tool, with its arguments in YAML.

md
```mcp tool=atlassian.jira_search name=tickets
jql: "project = PAY AND updated >= -7d"
limit: "{{limit}}"
```

script ​

A call to a script of the script registry. The YAML body gives the values of its arguments.

md
```script use=tempo.log each=entries confirm=true
issue: "{{item.issue}}"
hours: "{{item.hours}}"
```

http ​

A request in the .http format (REST Client / JetBrains). Any method other than GET, HEAD or OPTIONS needs confirm=true.

md
```http name=order
GET https://api.example.com/orders/{{orderId}}
Authorization: Bearer ${secret:shop.api_token}
```

js ​

Data processing in Node. The body is the body of an async function: write the statements directly and end with return. The returned value is the result of the block.

Available: params, inputs (the results of the from= blocks, by name), item, index, console. Each input is also a variable, with - turned into _ (jira-search → jira_search). There is no require, no fetch and no file access.

md
```js name=report from=list,tickets
const issues = tickets.issues ?? [];
return list.map((t) => ({
  Date: t.date,
  Hours: t.hours,
  Ticket: t.issue,
  Summary: issues.find((i) => i.key === t.issue)?.summary ?? "",
}));
```

Return an array of flat objects to get a table in the panel. MCP tools often return their result as JSON text: parse it when needed (typeof x === "string" ? JSON.parse(x) : x).

A js block is free code: it must be approved, and approved again after each change.

bash / sh ​

A shell command. No template is applied (no injection): parameters arrive as environment variables ZNOTE_PARAM_<NAME>, and the from= results as ZNOTE_INPUT_<NAME> (JSON).

Data blocks ​

Named json, yaml and csv blocks (csv sep=;) are data: their content is the block's result, usable with from= or each=.

Templates ​

FormWhereValue
{{param}}everywhere except bash and sqla parameter
{{block}}, {{block.path}}everywhere except bash and sqlthe result of a from= block
{{item}}, {{item.x}}, {{index}}each= blocksthe current item
{{today}}, {{today:YYYY-MM}}, {{now}}everywherelocal date
:param, :item.xsqlan escaped SQL literal
${secret:key}, ${local:key}http, mcp, mcp.jsona secret

In a YAML body (mcp, script), a value that is exactly "{{x}}" keeps its type (number, list, object). Otherwise it is rendered as text.

Chain blocks ​

A block can build its arguments from an earlier result. Here, a js block keeps the open tickets of a first search and builds the query of the second one:

md
```mcp tool=atlassian.jira_search name=search
jql: "{{query}}"
```

```js name=open from=search
const issues = (search.issues ?? []).filter((i) => i.status?.category !== "Done");
return { keys: issues.map((i) => i.key) };
```

```mcp tool=atlassian.jira_get_issue name=details each=open.keys
issue_key: "{{item}}"
```

Secrets ​

Never write a credential in an app. Reference it: ${secret:key} (shared, encrypted in the vault) or ${local:key} (this machine only). See Secrets. Resolved values are masked in every result.

Znote — your notes, your files, your machine.