Skip to main content
Glama

Create Document From Markdown

create_doc_from_markdown

Create a new AFFiNE document from Markdown content, with optional embedding into a parent document for sidebar visibility.

Instructions

Create a new AFFiNE document and import markdown content. Use parentDocId to automatically embed the new doc into a parent, making it visible in the sidebar instead of being an orphan.

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": {
      "markdown": "<markdown>"
    },
    "name": "create_doc_from_markdown"
  }
}

Input Schema

NameRequiredDescriptionDefault
titleNo
strictNo
markdownYesMarkdown content to import
parentDocIdNoIf provided, the new doc is automatically embedded into this parent doc as a linked child (visible in sidebar).
workspaceIdNoAFFiNE workspace id. Omit only when AFFINE_WORKSPACE_ID is configured.

Output Schema

NameRequiredDescriptionDefault
okYes
kindYes
docIdYes
lossyYes
statsYes
titleYes
warningsYes
parentDocIdYes
workspaceIdYes
linkedToParentYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.2.1

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already indicate this is a mutating (readOnlyHint=false), non-destructive (destructiveHint=false) operation. The description adds value by explaining the behavioral consequence of using `parentDocId`—the doc becomes visible in the sidebar instead of being an orphan. This context goes beyond the annotations and enhances transparency.

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

Conciseness5/5

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

The description is two sentences long, front-loads the primary purpose, and includes a practical tip without any fluff. Every word earns its place.

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

Completeness3/5

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

The description covers the core function and a key parameter, but it omits explanation of `strict` and doesn't clarify when to choose this tool over siblings. With an output schema present, return values are covered, but the missing parameter context and usage positioning leave gaps for a 5-parameter tool.

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

Parameters2/5

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

Schema description coverage is 60%, leaving `title` and `strict` undocumented. The description only rehashes the `parentDocId` behavior already present in the schema, adding no new meaning. The ambiguous `strict` parameter is not explained, so the description fails to compensate for the schema gaps.

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?

The description clearly states the tool creates a new AFFiNE document and imports markdown content, which is a specific verb+resource. However, it doesn't explicitly distinguish this tool from siblings like `create_doc` or `append_markdown`, so it's clear but not fully differentiated.

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

Usage Guidelines3/5

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

The description provides conditional usage guidance for `parentDocId`, explaining how to embed the new doc in the sidebar. But it doesn't explicitly state when to use this tool over alternatives like `create_doc` or `replace_doc_with_markdown`, so guidance is implied rather than direct.

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

Deploy Server

Other Tools