Skip to main content
Glama

yuque_get_doc

Retrieve document details from a Yuque repository by providing document ID and repository ID.

Instructions

获取文档详情 (Get document details)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
docIdYes文档ID (Document ID)
repoIdYes知识库ID (Repository ID)

Implementation Reference

  • The `handleGetDoc` function is the handler for the 'yuque_get_doc' tool. It accepts `docId` and `repoId` arguments, calls `client.getDoc(docId, repoId)` on the YuqueClient, and returns the document details as JSON text content.
    async function handleGetDoc(
      client: YuqueClient,
      args: { docId: number; repoId: number }
    ) {
      const doc = await client.getDoc(args.docId, args.repoId);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(doc, null, 2),
          },
        ],
      };
    }
  • The 'yuque_get_doc' tool is dispatched in the switch statement inside the `handleTool` function. When the tool name matches 'yuque_get_doc', it calls `handleGetDoc` with the client and typed arguments.
    case 'yuque_get_doc':
      return await handleGetDoc(
        client,
        args as { docId: number; repoId: number }
      );
  • The tool definition for 'yuque_get_doc' registers the tool name, description ('获取文档详情 (Get document details)'), and input schema with required fields `docId` (number) and `repoId` (number).
    {
      name: 'yuque_get_doc',
      description: '获取文档详情 (Get document details)',
      inputSchema: {
        type: 'object',
        properties: {
          docId: {
            type: 'number',
            description: '文档ID (Document ID)',
          },
          repoId: {
            type: 'number',
            description: '知识库ID (Repository ID)',
          },
        },
        required: ['docId', 'repoId'],
      },
    },
  • The `getDoc` method on `YuqueClient` makes the actual API request to fetch a document. It calls GET `/repos/${repoId}/docs/${docId}` via the internal `request` method and returns a `YuqueDoc`.
    async getDoc(docId: number, repoId: number): Promise<YuqueDoc> {
      return this.request<YuqueDoc>(`/repos/${repoId}/docs/${docId}`);
    }
Behavior2/5

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

No annotations are provided. The description merely restates the action; it does not disclose safety (read-only is implied but not explicit), error handling (e.g., 404), or rate limits. Minimal behavioral context.

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

Conciseness3/5

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

Single sentence in two languages; concise but at the expense of completeness. Lacks structure or front-loading of critical details.

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?

Simple tool with 2 params and no output schema, yet description fails to indicate what document details are returned (e.g., content, metadata). Context is incomplete for an agent to understand the return value.

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 coverage is 100%, so the input schema already documents both parameters. The description adds no extra meaning beyond what the schema provides, meeting the baseline for full coverage.

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 retrieves document details (获取文档详情) with a specific verb and resource. It distinguishes from siblings like yuque_get_docs (list) and yuque_create_doc (create).

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?

No guidance on when to use this tool vs alternatives like yuque_get_docs or yuque_search_docs. The description provides no context for selection criteria.

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