Skip to main content
Glama

yuque_update_doc

Update existing documents in Yuque knowledge bases by modifying titles, content, and formats using document and repository IDs.

Instructions

更新文档 (Update existing document)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
docIdYes文档ID (Document ID)
repoIdYes知识库ID (Repository ID)
titleNo文档标题 (Document title)
contentNo文档内容 (Document content)
formatNo文档格式 (Document format)

Implementation Reference

  • Tool schema definition for 'yuque_update_doc', including input validation schema.
    {
      name: 'yuque_update_doc',
      description: '更新文档 (Update existing document)',
      inputSchema: {
        type: 'object',
        properties: {
          docId: {
            type: 'number',
            description: '文档ID (Document ID)',
          },
          repoId: {
            type: 'number',
            description: '知识库ID (Repository ID)',
          },
          title: {
            type: 'string',
            description: '文档标题 (Document title)',
            minLength: 1,
            maxLength: 200,
          },
          content: {
            type: 'string',
            description: '文档内容 (Document content)',
          },
          format: {
            type: 'string',
            enum: ['markdown', 'lake', 'html'],
            description: '文档格式 (Document format)',
          },
        },
        required: ['docId', 'repoId'],
      },
    },
  • The primary handler function that executes the yuque_update_doc tool logic by invoking the Yuque client and formatting the response.
    async function handleUpdateDoc(
      client: YuqueClient,
      args: {
        docId: number;
        repoId: number;
        title?: string;
        content?: string;
        format?: 'markdown' | 'lake' | 'html';
      }
    ) {
      const doc = await client.updateDoc(
        args.docId,
        args.repoId,
        args.title,
        args.content,
        args.format
      );
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(doc, null, 2),
          },
        ],
      };
    }
  • src/server.ts:46-50 (registration)
    Registers the listTools endpoint which provides the schema for yuque_update_doc via YUQUE_TOOLS.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: YUQUE_TOOLS,
      };
    });
  • src/server.ts:53-56 (registration)
    Registers the callTool endpoint which dispatches to handleTool, eventually executing yuque_update_doc handler.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      try {
        return await handleTool(request, { client: yuqueClient });
      } catch (error) {
  • Helper method in YuqueClient that performs the actual API PUT request to update the document.
    async updateDoc(
      docId: number,
      repoId: number,
      title?: string,
      content?: string,
      format?: 'markdown' | 'lake' | 'html'
    ): Promise<YuqueDoc> {
      const data: any = {};
      if (title) data.title = title;
      if (content) data.body = content;
      if (format) data.format = format;
    
      return this.request<YuqueDoc>(`/repos/${repoId}/docs/${docId}`, {
        method: 'PUT',
        data,
      });
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states it's an update operation but doesn't disclose whether this requires specific permissions, what happens to unspecified fields (partial vs full updates), whether changes are reversible, or any rate limits/constraints. For a mutation tool with zero annotation coverage, this is inadequate.

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?

The description is extremely concise (one bilingual phrase) with zero wasted words. However, it's arguably too brief for a mutation tool with 5 parameters and no annotations, potentially under-specifying rather than being optimally concise.

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

Completeness2/5

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

For a document update tool with 5 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain the update behavior (partial/full), permissions needed, error conditions, or what the tool returns. The schema handles parameter documentation well, but the description fails to provide necessary operational context.

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

Parameters3/5

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

Schema description coverage is 100%, providing good documentation for all 5 parameters. The description adds no parameter-specific information beyond what's in the schema (it doesn't explain parameter relationships, validation rules, or usage examples). Baseline 3 is appropriate when schema does the heavy lifting.

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 verb ('更新/Update') and resource ('文档/document'), specifying it updates an existing document. It distinguishes from 'yuque_create_doc' by focusing on updates rather than creation. However, it doesn't specify what aspects are updated (title, content, format) or mention the required repository context.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites like needing an existing document ID, when to choose update over create/delete, or how it differs from similar tools like 'yuque_create_doc' beyond the basic verb difference.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tanis2010/yuque-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server