Strata 文档
Strata 是一个 AI 驱动的文档编辑平台。上传 Markdown 或 HTML 文档,进行查看、评论和编辑,采用基于段落的文档模型,通过 MCP(模型上下文协议)实现精细的 AI 编辑。
快速开始
将您的 AI 客户端连接到 Strata 的 MCP 服务器,即可读取、编辑、搜索和管理文档。大多数客户端会自动处理 OAuth——只需提供服务器 URL。
连接详情
- MCP 服务器 URL
https://api.strata.space/mcp- 认证
- OAuth 2.1 with Dynamic Client Registration
- 可用工具
app_get_section_content,browse_connector_resources,edit_document,export_presentation,find,get_agent_status,get_company_theme,get_document_graph,get_image,get_presence,get_publish_status,invoke_agent,invoke_connector_action,list_company_themes,list_connected_tools,manage_comments,manage_suggestions,publish_document,read_document,unpublish_document,validate_presentation
客户端设置
正在使用 Claude Code?Strata 插件是最快的接入方式:一条命令即可注册 MCP 服务器并添加 Spaces 技能。
Claude Desktop
添加到您的 claude_desktop_config.json:
{
"mcpServers": {
"strata": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://api.strata.space/mcp"
]
}
}
}OAuth 认证会自动处理——首次使用时会提示您登录。
Claude Code
通过 CLI 添加 Strata MCP 服务器:
claude mcp add strata https://api.strata.space/mcpOAuth 认证会通过您的浏览器自动处理。
Cursor
添加到 ~/.cursor/mcp.json 或 .cursor/mcp.json:
{
"mcpServers": {
"strata": {
"url": "https://api.strata.space/mcp"
}
}
}当服务器返回 401 时,Cursor 会自动处理 OAuth。
VS Code (Copilot)
添加到项目中的 .vscode/mcp.json:
{
"servers": {
"strata": {
"type": "http",
"url": "https://api.strata.space/mcp"
}
}
}需要 VS Code 1.101+。使用 "servers"(而非 "mcpServers")和类型 "http"。带 PKCE 和动态客户端注册的 OAuth 会自动处理。
Windsurf
添加到 ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"strata": {
"serverUrl": "https://api.strata.space/mcp"
}
}
}Windsurf 使用 serverUrl 而非 url。OAuth 会自动处理。
Cline
在 Cline 中打开 MCP Servers 面板并添加到配置中:
{
"mcpServers": {
"strata": {
"url": "https://api.strata.space/mcp",
"type": "streamableHttp"
}
}
}使用 "streamableHttp"(驼峰式命名)。需要 OAuth 时,Cline 会显示认证按钮。
Continue
添加到 ~/.continue/config.yaml:
mcpServers:
- name: strata
command: npx
args:
- "-y"
- "mcp-remote"
- "https://api.strata.space/mcp"Continue 尚不原生支持 OAuth。请改用 mcp-remote 桥接(见下文)。
Zed
添加到 Zed 的 settings.json:
{
"context_servers": {
"strata": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://api.strata.space/mcp"
]
}
}
}Zed 不原生支持 OAuth。使用 mcp-remote 作为 stdio 桥接,在浏览器中处理 OAuth 流程。
Claude.ai 与 ChatGPT
这些聊天产品将 Strata 编辑器以自定义连接器的形式内联渲染。在主机的连接器设置中填入上方的 MCP 服务器 URL。
Claude.ai
设置 → 连接器 → 添加自定义连接器
适用于付费套餐。组织连接器由所有者添加。
ChatGPT
设置 → 连接器 → 创建
需要开发者模式(设置 → 应用与连接器 → 高级)。Plus、Pro 或 Enterprise 套餐。
通用方案 (mcp-remote)
对于不原生支持 OAuth 的客户端,可使用 mcp-remote 作为 stdio 桥接。它处理完整的 OAuth 流程,适用于任何 MCP 客户端:
{
"mcpServers": {
"strata": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://api.strata.space/mcp"
]
}
}
}认证状态保存在 ~/.mcp-auth/ 中,每个服务器只需认证一次。
后续步骤
查看 MCP 工具参考 了解所有可用工具及其参数的完整文档。
博客设计
在第一个 YAML 前置信息块中使用 blog: 映射来设计已发布的文章。外观面板编辑同一份文本,并保留其他键和注释。
预览随草稿更新。发布会保存完整设计,包括从发布主题继承的默认值;之后修改草稿或个人主页主题不会改变该版本。演示文稿使用各自的设置。前置信息不会出现在公开页面和描述中。
blog: 中的未知键、格式错误的 YAML、无效值、缺失或重名的引用以及对比度不足都会阻止发布。请修复所有错误;智能体编辑会返回 blogValidation 结果。重置设置即可继承默认值。目录默认隐藏,阅读区域默认不透明。
摘要最多160个字符;标签最多10个,每个32个字符。系列名称最多80个字符,顺序必须为正整数。名称完全相同的系列文章会归为一组;重复序号会产生警告。noindex 保留个人主页和订阅源中的文章,但将其从站点地图中移除,并请求搜索引擎不要索引。cover 指定文档内的图片名称;请在图片前紧接着添加 <!-- strata:name=cover --> 为其命名。
颜色需要分别为浅色和深色模式提供带引号的 #RRGGBB 值。background 设置阅读区域的颜色,没有壁纸时也设置页面背景。正文和 accent 链接在两种模式下都必须与实际阅读区域达到4.5:1的对比度。字体需从下方列表中选择。半透明阅读区域的不透明度为88%,仅可用于单色或整个渐变范围内对比度充足的渐变壁纸。
只能选择一种壁纸类型。渐变支持2至5个色标;图案使用下方列出的名称。图片壁纸指定文档内的图片名称。HTML 壁纸指定 html 代码块名称,且必须提供静态备用颜色或图片。它在现有沙盒内运行于文章后方,不接收点击或焦点,并在标签页隐藏时停止。减少动态效果、节省流量、设备性能有限、关闭 HTML 预览或发生错误时会使用备用背景。打印和 PDF 不包含壁纸。不支持直接修改页面 HTML 或 CSS,也不支持整页 HTML 文章。
声明 uses="frontmatter" 的 HTML 块通过 strata.data.get("frontmatter").values 读取数据。解析后的设计键包括 blog.typography、blog.palette、blog.readingWidth、blog.blockControls、blog.tableOfContents、blog.readingSurface、blog.accent、blog.background、blog.fonts.heading 和 blog.fonts.body。颜色对应当前模式,未设置的字体会被省略。公开块仅接收这些设计值;其他标量前置信息仅在编辑器中可用。壁纸也只接收这些值和颜色模式,不会接收其他文档数据。
字段及允许的值
blog.typographymodern | editorial | expressive | technicalblog.palettestrata | paperblog.readingWidthfocused | comfortable | wide | fullblog.blockControlsvisible | hiddenblog.tableOfContentsvisible | hiddenblog.accent{ light: "#RRGGBB", dark: "#RRGGBB" }blog.background{ light: "#RRGGBB", dark: "#RRGGBB" }blog.fonts.heading, blog.fonts.bodyManrope | Syne | Fira Code | Georgia | Times New Roman | Arial | Helvetica | Verdana | Trebuchet MS | Palatino | Courier New | IBM Plex Monoblog.summarystring (1…160)blog.coverimage.nameblog.tagsstring[] (0…10 × 1…32)blog.noindextrue | falseblog.series{ name: string (1…80), order: integer (≥1) }blog.wallpaper.color{ light: "#RRGGBB", dark: "#RRGGBB" }blog.wallpaper.gradient{ type: linear | radial, stops: [{ light: "#RRGGBB", dark: "#RRGGBB" }, …] } (2…5)blog.wallpaper.pattern{ name: dots | grid | lines | paper | topographic | stars, tint: { light: "#RRGGBB", dark: "#RRGGBB" } }blog.wallpaper.imageimage.nameblog.wallpaper.htmlcodeBlock.name (language: html)blog.wallpaper.fallback{ color: { light: "#RRGGBB", dark: "#RRGGBB" } } | { image: image.name }blog.readingSurfaceopaque | translucent
完整 HTML 壁纸示例
---
blog:
typography: editorial
palette: paper
readingWidth: comfortable
blockControls: hidden
tableOfContents: visible
accent: { light: "#8a3515", dark: "#ffb788" }
background: { light: "#fffdf8", dark: "#272119" }
fonts: { heading: Georgia, body: Georgia }
summary: "An astronomy journal about the night sky."
tags: [astronomy, observation]
noindex: false
series: { name: "Night notes", order: 1 }
readingSurface: opaque
wallpaper:
html: starfield
fallback:
color: { light: "#e7e0d4", dark: "#111827" }
---
# Night notes
Our first observing session began at twilight.
## The northern sky
The article stays on an opaque reading surface above the animation.
```html name=starfield uses="frontmatter"
<style>
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
canvas { display: block; width: 100%; height: 100%; }
</style>
<canvas id="sky"></canvas>
<script>
const canvas = document.getElementById('sky');
const ctx = canvas.getContext('2d');
let color = '#8a3515';
function readDesign() {
const source = strata.data.get('frontmatter');
if (source?.kind === 'frontmatter') color = source.values['blog.accent'];
}
readDesign();
window.addEventListener('strata:data', readDesign);
function paint(time) {
const width = canvas.clientWidth, height = canvas.clientHeight;
if (canvas.width !== width || canvas.height !== height) {
canvas.width = width;
canvas.height = height;
}
ctx.clearRect(0, 0, width, height);
ctx.fillStyle = color;
for (let i = 0; i < 90; i++) {
ctx.globalAlpha = 0.25 + 0.25 * Math.sin(time / 1800 + i);
ctx.beginPath();
ctx.arc((i * 137.508 % 100) / 100 * width,
(i * 71.37 % 100) / 100 * height, 1 + i % 2, 0, Math.PI * 2);
ctx.fill();
}
requestAnimationFrame(paint);
}
requestAnimationFrame(paint);
</script>
```交互式 HTML 块
标记为 html 的代码块会在 Strata 编辑器和导出的 PDF 中渲染为实时的沙箱预览——图表、示意图、3D 场景以及小型交互式组件,都以普通的围栏代码形式编写。
编写一个使用 html 语言标记的围栏代码块。其中的标记、样式和脚本会自动在隔离的预览中运行;每次编辑都会从干净状态重新渲染,读者可以在预览和源码之间切换。
预览是完全隔离的:没有 Cookie 或存储,无法访问外层页面,也不能使用外部 URL。WebSocket、信标和表单提交被彻底移除,fetch 只能访问下方列出的、经过审核的 /sandbox/ 资源,Doom 引擎正是通过这一途径加载自己的游戏数据。任何违反上述约束的操作只会在其所属预览内失败,不会影响其他地方。
Strata 设计令牌已预先加载:var(--color-foreground)、var(--color-muted-foreground)、var(--color-primary)、var(--color-border) 等 CSS 变量与应用主题一致,预览也会自动跟随查看者的浅色或深色模式。你自己设置的颜色会被原样使用,不会做任何调整,因此请同时设置背景色和文字色——只设置其中一项的块,在你没有测试过的模式下可能会变得无法阅读。
预览的初始高度约为 360 像素,之后会跟随内容变化:内容更高时块会变大,内容更短时块会收缩。这个初始高度同时也是相对单位的解析基准,因此 height: 100%、100vh 和 window.innerHeight 都能正常工作——这正是 three.js 场景和铺满整个块的图表通常依赖的写法。
脚本错误、未处理的 Promise 拒绝,以及预览内部输出的 console.error 与 console.warn 内容,都会被收集并显示在预览下方;浏览器报告行号时也会一并列出。预览没有自己的开发者工具,因此这个面板就是块用来说明自己为何没有渲染的地方。
用文档数据绘制图表
块可以读取同一文档中已有的数据,因此图表始终与读者看到的数字保持一致。可以命名的数据源有四种。json、csv、tsv 或 yaml 代码块在自己的起始行上命名,例如 name=sales。表格通过紧挨其上方的一行 HTML 注释来命名:<!-- strata:name=headcount -->。文档的 frontmatter 始终以保留名称 frontmatter 提供,且仅包含标量字段。文档中的图片与表格同样命名,用紧挨其上方的一行 HTML 注释:<!-- strata:name=hero -->。在编辑器中选中图片,使用数据名称。块只能绑定这四种数据。名称以字母开头,后面可以是字母、数字、连字符或下划线,最长 64 个字符,并且在文档内必须唯一。
html 块在自己的起始行上声明所使用的数据,例如 uses="sales,headcount"。块只会收到它所声明的数据源,绝不会收到文档的其余内容。它无法访问另一个文档中的数据,也不会收到读者在本文档中看不到的任何内容。修改块的代码或声明会让预览从干净状态重新加载。仅修改已声明名称背后的数据,则会就地更新正在运行的预览。一个块最多声明八个名称;从第九个开始的名称不会被悄悄丢弃,而是以 unavailable 送达,原因为 oversize。
在预览内部,声明的数据会在你自己的脚本运行之前以 strata.data 的形式准备好。strata.data.get(name) 返回一个数据源,strata.data.names 按声明顺序列出块声明的名称。json、csv、tsv 或 yaml 数据源以未解析的 { kind: 'text', format, text } 形式送达,由块自行用其偏好的解析器解析。表格以 { kind: 'table', columns, rows } 形式送达,每个单元格都是纯文本,不做数字或日期转换。frontmatter 以 { kind: 'frontmatter', values } 形式送达。送达的所有值都被深度冻结。绑定的数据源发生变化时,Strata 会推送新的快照,并在 window 上触发 strata:data 事件,其 detail 携带新数据。事件触发时,strata.data.get 已经返回该快照。预览自身从不请求数据,因此忽略该事件的块会继续使用最初收到的数据运行。
图片以 { kind: 'image', url, width, height, alt } 的形式送达,url 是携带图片自身字节的数据 URL,因此块无需任何网络访问即可直接赋给 img 元素。Strata 以读者本人的权限获取这些字节,并在预览启动前内联;预览永远不会看到可以跟随的链接,也不会自己请求图片。图片有单独的配额:单张图片最多 3 MiB,一个预览中的所有图片合计最多 12 MiB,超出时优先丢弃最大的。无法获取字节的图片会以原因 unreachable 的 unavailable 送达。演示文稿无需任何代码即可展示已命名的图片:写作 layout=image uses="hero" 的幻灯片起始行会将其满幅绘制,并从幻灯片正文读取图注。
选哪一种,取决于还有谁要读这些数字。json 或 csv 代码块紧凑、便于比较版本,也能把较长的数列放在正文之外,但它以原始文本送达,解析要由块自己完成;按逗号切分 csv 行是典型的错误,因为这样会把任何含逗号的带引号字段拆散。命名表格则是相反的取舍:读者看到的是真正的表格而不是一段代码块,块拿到的数据也已经分好,第一行作为 columns,其后的每一行放进 rows。frontmatter 适合标题或目标这类单个值,而不适合数列。
无法解析的已声明名称仍会送达,形式为 { kind: 'unavailable', reason },这样块就能区分空数据集与缺失的数据集。当文档中没有数据源使用该名称时,原因为 unknown;两个数据源使用同一名称时为 duplicate;预览打开期间数据源被删除时为 removed;数据源超出投递限制时为 oversize;图片字节无法获取时为 unreachable。只有受影响的数据源会被丢弃,其余仍会送达,因此请检查 unavailable 类型并给出提示,而不要假定数据一定存在。
经过审核的库
/sandbox/libs/mermaid.min.js— <script src="/sandbox/libs/mermaid.min.js"></script> then mermaid.initialize({ startOnLoad: false }); mermaid.run()/sandbox/libs/d3.min.js— <script src="/sandbox/libs/d3.min.js"></script> — global `d3`/sandbox/libs/three.module.min.js— <script type="module">import * as THREE from '/sandbox/libs/three.module.min.js'</script>/sandbox/libs/doom.js— <script src="/sandbox/libs/doom.js"></script> is the whole block: it appends its own canvas and boots. Options go on the script tag: data-doom-warp="1,1", data-doom-skill="3", data-doom-manual (call Doom.start() yourself). To place the canvas, supply one with id="canvas". The reader clicks the preview once to give it keyboard focus; arrows move, Ctrl fires, Esc opens the menu. Music is off, sound effects work. First load pulls about 10 MB, then caches. Chocolate Doom compiled to WebAssembly (GPL-2.0-or-later, github.com/cloudflare/doom-wasm) with Freedoom game data (BSD-3-Clause, github.com/freedoom/freedoom). No commercial or shareware WAD is distributed.
预览中不会加载其他任何外部脚本或样式 URL。若要固定版本,请在 .min.js 前插入 -<version>(旧版本仍然可用)。
示例
<div id="chart"></div>
<script src="/sandbox/libs/d3.min.js"></script>
<script>
const data = [4, 8, 15, 16, 23, 42];
d3.select('#chart')
.selectAll('div')
.data(data)
.join('div')
.style('height', '18px')
.style('margin', '2px 0')
.style('background', 'var(--color-primary, #2c7cb0)')
.style('width', (d) => d * 6 + 'px');
</script>示例:绑定到 json 代码块的图表
```json name=sales
[
{ "quarter": "Q1", "revenue": 42 },
{ "quarter": "Q2", "revenue": 58 },
{ "quarter": "Q3", "revenue": 71 }
]
```
```html uses="sales"
<div id="chart"></div>
<script src="/sandbox/libs/d3.min.js"></script>
<script>
function render() {
const source = strata.data.get('sales');
if (!source || source.kind !== 'text') return;
d3.select('#chart')
.selectAll('div')
.data(JSON.parse(source.text))
.join('div')
.style('height', '18px')
.style('margin', '2px 0')
.style('background', 'var(--color-primary, #2c7cb0)')
.style('width', (d) => d.revenue * 6 + 'px');
}
render();
window.addEventListener('strata:data', render);
</script>
```示例:绑定到 csv 代码块的图表
```csv name=signups
week,signups
"Jan 1, 2026",120
"Jan 8, 2026",148
"Jan 15, 2026",173
"Jan 22, 2026",162
```
```html uses="signups"
<div id="chart"></div>
<script src="/sandbox/libs/d3.min.js"></script>
<script>
function render() {
const chart = d3.select('#chart');
chart.selectAll('*').remove();
const source = strata.data.get('signups');
if (!source || source.kind !== 'text') {
chart.text('No signups data.');
return;
}
// A csv source arrives as raw text. text.split(',') would tear
// "Jan 1, 2026" in half; d3.csvParse honours the quotes.
const rows = d3.csvParse(source.text, (row) => ({
week: row.week,
signups: Number(row.signups),
}));
const scale = d3
.scaleLinear()
.domain([0, Math.max(1, d3.max(rows, (d) => d.signups) || 0)])
.range([0, 100]);
const line = chart.selectAll('div').data(rows).join('div');
line
.style('display', 'flex')
.style('align-items', 'center')
.style('gap', '8px')
.style('margin', '2px 0');
line
.append('span')
.style('flex', '0 0 7rem')
.style('color', 'var(--color-muted-foreground, #6b7280)')
.text((d) => d.week);
line
.append('span')
.style('height', '18px')
.style('background', 'var(--color-primary, #2c7cb0)')
.style('width', (d) => scale(d.signups) + '%');
line.append('span').text((d) => d.signups);
}
render();
// Edit a number in the csv block and this chart follows it.
window.addEventListener('strata:data', render);
</script>
```示例:绑定到文档表格的图表
<!-- strata:name=headcount -->
| Team | People |
| --- | --- |
| Growth | 12 |
| Platform | 27 |
| Support | 8 |
```html uses="headcount"
<div id="chart"></div>
<script>
function render() {
const chart = document.getElementById('chart');
chart.textContent = '';
const source = strata.data.get('headcount');
if (!source || source.kind !== 'table') {
chart.textContent = 'No headcount table.';
return;
}
// columns is the table's first row; rows is everything under it, and
// every cell is a string, so the numbers are yours to convert.
const team = source.columns.indexOf('Team');
const people = source.columns.indexOf('People');
const counts = source.rows.map((row) => Number(row[people]) || 0);
const widest = Math.max(1, ...counts);
source.rows.forEach((row, index) => {
const line = document.createElement('div');
line.style.display = 'flex';
line.style.alignItems = 'center';
line.style.gap = '8px';
line.style.margin = '2px 0';
const label = document.createElement('span');
label.style.flex = '0 0 7rem';
label.style.color = 'var(--color-muted-foreground, #6b7280)';
label.textContent = row[team];
const bar = document.createElement('span');
bar.style.height = '18px';
bar.style.width = (counts[index] / widest) * 100 + '%';
bar.style.background = 'var(--color-primary, #2c7cb0)';
const value = document.createElement('span');
value.textContent = row[people];
line.append(label, bar, value);
chart.append(line);
});
}
render();
// Type a new number into the table and this chart follows it.
window.addEventListener('strata:data', render);
</script>
```示例:绑定到文档图片的图像
<!-- strata:name=hero -->

```html uses="hero"
<figure id="card" style="margin:0"></figure>
<script>
function render() {
const card = document.getElementById('card');
card.textContent = '';
const source = strata.data.get('hero');
if (!source || source.kind !== 'image') {
card.textContent = 'No hero image.';
return;
}
const image = document.createElement('img');
// url already carries the bytes, so this needs no network access.
image.src = source.url;
image.alt = source.alt;
image.style.width = '100%';
image.style.borderRadius = '12px';
const caption = document.createElement('figcaption');
caption.style.color = 'var(--color-muted-foreground, #6b7280)';
caption.textContent = source.width + '×' + source.height;
card.append(image, caption);
}
render();
// Swap the image in the document and this card follows it.
window.addEventListener('strata:data', render);
</script>
```代理 frontmatter
代理定义是位于 /Agents 文件夹中的 Markdown 文档。YAML frontmatter 声明代理的身份、允许使用的工具列表以及对编排器的可见性;frontmatter 下方的正文是编排器原样转交给代理的系统提示。所有字段在保存时都会在服务器端进行校验。
| 字段 | 类型 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|---|
autoInvokable | boolean | 可选 | false | 为 true 时,如果描述与用户请求相符,聊天编排器可以自行选择该代理。为 false(默认)时,仅在显式调用(@mention、MCP invoke_agent 或已连接的源)下才会运行。 |
connectorAccounts | object | 可选 | — | Owner's personal account selected for each connector kind. |
description | string | 必填 | — | 用一句话概括何时应使用此代理。该描述会出现在编排器的自动调用目录和 @mention 选择器中——请具体说明该代理负责的工作。 |
enabled | boolean | 可选 | true | 总开关。为 false 时,即使 frontmatter 其他部分有效,代理也会在所有调用表面被隐藏。 |
model | string | 可选 | — | 可选项,用于覆盖代理运行的模型。若省略则使用平台默认模型;必须能在平台模型注册表中解析。 |
name | string | 必填 | — | kebab-case 标识符([a-z0-9-]),需在你的代理中保持唯一,并且不能与平台预留的代理名称冲突。决定聊天中的 @mention 标记以及 MCP invoke_agent 的 agentName 参数。 |
pinnedResources | PinnedResourceSpec[] | 可选 | — | External resources pinned to this agent as standing knowledge. A compact manifest is injected into every run and the bodies are fetched live with the owner's connector grant. Omit or pass an empty list for no pinned knowledge. |
tools | string[] | 可选 | [] | 代理可调用的平台工具白名单(例如 read_document、search_space)。代理横幅中的“可用工具”面板会列出所有有效名称。若不授予任何工具,请留空或省略此字段。 |
示例
---
name: meeting-notes-summarizer
description: Summarizes meeting notes into a TL;DR with action items.
tools:
- read_document
- search_space
model: claude-sonnet-4-6
color: emerald
enabled: true
autoInvokable: false
---
You are a meeting-notes summarizer. Given the document body the
orchestrator hands you verbatim, produce a one-paragraph TL;DR and a
bulleted action-item list…
提示词 frontmatter
提示词模板是位于 /Prompts 文件夹中的 Markdown 文档。YAML frontmatter 声明名称、描述、参数以及对编排器的可见性;frontmatter 下方的正文即提示词模板——{{argument}} 占位符会在渲染时被替换。参数值由聊天输入栏的斜杠面板或 MCP prompts/get 请求收集。
| 字段 | 类型 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|---|
arguments | PromptArgument[] | 可选 | [] | 提示词正文通过 `{{name}}` 占位符引用的 `PromptArgument` 条目有序列表。顺序在传输时保留,以便斜杠选择器按作者指定的顺序显示各字段。最多 16 条。 |
autoInvokable | boolean | 可选 | false | 为 true 时,如果描述与用户意图相符,聊天编排器可以自行选择该提示词。为 false(默认)时,仅在用户输入对应的斜杠标记或客户端调用 MCP prompts/get 时才会运行。 |
description | string | 必填 | — | 用一句话概括提示词的功能。会出现在斜杠菜单、MCP prompts/list 中,以及当 autoInvokable: true 时也会出现在编排器的工具目录里。 |
name | string | 必填 | — | 可读的提示词标题。其 slug 形式会成为聊天输入栏斜杠菜单中显示的 /prompt:<slug> 标记。 |
PromptArgument
上方 `arguments` 数组中的每个条目具有以下结构:
| 字段 | 类型 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|---|
description | string | 必填 | — | Short human-readable description shown in the slash-picker argument sheet, the MCP `prompts/list` payload, and the `loadUserPrompt` catalog so the user (or the model) knows what to fill in. 1-200 chars. |
name | string | 必填 | — | Identifier matched verbatim against the body's `{{name}}` placeholders. Matching is case-sensitive — `{{Focus}}` and `{{focus}}` are distinct placeholders. Restricted to ASCII letters, digits, and underscores (1-48 chars) so the same identifier is valid in YAML and the placeholder grammar. |
required | boolean | 可选 | false | When true, the slash-picker argument sheet blocks submit until a value is supplied; the `loadUserPrompt` catalog also flags it so the model knows it must ask the user to clarify. When false (default), an omitted argument substitutes the empty string into its placeholders at render time. |
示例
---
name: Summarize document
description: Summarize the active document for a chosen audience.
autoInvokable: false
arguments:
- name: focus
description: What the assistant should focus on.
required: true
- name: audience
description: Target audience for the summary.
required: false
---
Summarize this document for {{audience}}, focusing on {{focus}}. Keep
the summary under 200 words and finish with a short action-items list.
模板 frontmatter
文档模板是模板文件夹中的 Markdown 文档。YAML frontmatter 声明模板的名称、带类型的变量和章节结构;frontmatter 下方的正文是可复用的内容。当通过模板库、MCP 的 createFromTemplate 操作或代理的 create_document_from_template 工具基于模板创建文档时,{{key}} 占位符会被替换。
| 字段 | 类型 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|---|
description | string | 必填 | — | Sentence describing when to use this template. Surfaces in the gallery and in tool catalogs, so be specific about the document shape it produces. |
name | string | 必填 | — | Kebab-case identifier, unique among the templates in the same folder. Shown in the gallery alongside the document title. |
sections | TemplateSection[] | 可选 | [] | Section contract: what a conforming instance must contain. Maximum 64 entries. Empty when the template declares no section structure. |
variables | TemplateVariable[] | 可选 | [] | Typed placeholders substituted at instantiation. Order is preserved across the wire so fill-in forms render fields in the author's chosen order. Maximum 16 entries. Empty when the template takes no variables. |
TemplateVariable
上方 `variables` 数组中的每个条目具有如下形式:
| 字段 | 类型 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|---|
key | string | 必填 | — | Identifier matched verbatim against the body's `{{key}}` placeholders. Matching is case-sensitive. Restricted to ASCII letters, digits, and underscores (1-64 chars) so the same identifier is valid in YAML and the placeholder grammar. |
kind | unknown | 可选 | "text" | Input kind. Defaults to free text. |
label | string | 必填 | — | Human-readable label shown on the fill-in form. 1-80 chars. |
required | boolean | 可选 | false | When true, instantiation fails unless a value is supplied. When false (default), an omitted variable substitutes the empty string into its placeholders. |
TemplateSection
上方 `sections` 数组中的每个条目具有如下形式:
| 字段 | 类型 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|---|
fill | unknown | 可选 | "required" | Fill discipline for the section. Defaults to required. |
guidance | string | 可选 | "" | Instructions for whoever (or whatever) fills the section in. Optional; shown alongside the section in fill-in surfaces. |
title | string | 必填 | — | Section title. Matches a heading in the template body verbatim. |
示例
---
name: incident-postmortem
description: Standard postmortem with a verbatim escalation matrix.
variables:
- key: incident_id
label: Incident ID
kind: text
required: true
- key: occurred_on
label: Date of incident
kind: date
required: true
sections:
- title: Timeline
guidance: Chronological events from first alert to resolution.
fill: required
- title: Lessons learned
guidance: What we change going forward.
fill: optional
- title: Escalation matrix
fill: verbatim
---
## Timeline
Incident {{incident_id}} on {{occurred_on}}.
## Lessons learned
## Escalation matrix
Page the on-call lead, then the service owner…