Skip to main content
Glama

创建文档

gwl_create_document

Create a Markdown document with a required title and optional slug, content, visibility, and folder, returning version 1 details. Check existing documents before retrying after a network failure.

Instructions

创建一篇文档,返回文档详情(含 content,version=1)。 title 必填非空;slug 省略时上游按毫秒时间戳自动生成,已占用则 400。 写入范围(visibility/owning/folder_id/permission_bits)由服务端做写边界校验,越界返回 403;folder_id 不存在返回 400。 本工具不幂等:网络失败时不要盲目重试,先用 gwl_list_my_documents 确认是否已经建过。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "title": "<title>"
    },
    "name": "gwl_create_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
iconNo
slugNo自定义 slug(全站唯一)。省略则自动生成。
titleYes标题(1~200 个字符)。
owningNo
contentNo文档正文(Markdown)。
summaryNo
folder_idNo归属文件夹 id。省略=根目录(0)。
visibilityNo
permission_bitsNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Adds error semantics the annotations do not carry: 400 on slug collision, 400 on missing folder_id, 403 when visibility/owning/folder_id/permission_bits exceed the server write boundary. '本工具不幂等' largely restates idempotentHint=false, but the recovery procedure attached to it is genuinely additive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four dense lines, front-loaded with what is returned before constraints and failure modes. Minor redundancy in stating 'title 必填非空' when the schema already enforces minLength 1, but nothing is padded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 9-parameter mutation tool with an output schema, the description covers return shape, hard validation failures, write-boundary authorization, and retry safety. Since an output schema exists, no further return-value detail is required.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Adds real meaning beyond the 44%-covered schema: slug is auto-generated from a millisecond timestamp when omitted and collides with a 400, folder_id must exist or the call fails, and the four write-scope fields share a server-side boundary check. content, icon and summary are left to the schema, which does document them.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('创建一篇文档') plus the return shape ('返回文档详情(含 content,version=1)'), so an agent knows exactly what it produces. It does not explicitly differentiate itself from gwl_update_document, but the create semantics are unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly warns that the tool is non-idempotent and prescribes the alternative workflow on failure ('先用 gwl_list_my_documents 确认是否已经建过'), naming the sibling tool and the condition. That is a concrete when-to-check rule rather than generic advice.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.