Skip to main content
Glama

yuque_get_doc

Retrieve detailed document content from Yuque knowledge bases using document and repository IDs for API integration and data access.

Instructions

获取文档详情 (Get document details)

Input Schema

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

Implementation Reference

  • The main handler function for the 'yuque_get_doc' tool. It extracts docId and repoId from arguments, calls YuqueClient.getDoc to fetch the document details, and returns the result as formatted 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 tool definition and input schema for 'yuque_get_doc', specifying required numeric parameters docId and repoId.
    {
      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'],
      },
    },
  • Registration of the 'yuque_get_doc' handler within the central tool dispatch switch statement in handleTool.
    case 'yuque_get_doc':
      return await handleGetDoc(
        client,
        args as { docId: number; repoId: number }
      );
  • src/server.ts:46-50 (registration)
    Registration for listing all tools, including 'yuque_get_doc', by returning the YUQUE_TOOLS array containing its definition.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: YUQUE_TOOLS,
      };
    });
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'get' implies a read operation, but doesn't cover aspects like authentication needs, rate limits, error handling, or what the return format looks like (e.g., structured data vs. raw text). For a tool with no annotation coverage, this is a significant gap in transparency.

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 a single, efficient sentence in both Chinese and English ('获取文档详情 (Get document details)'), making it front-loaded and concise. However, it could be more structured by including key details like the tool's scope or limitations, but it avoids unnecessary verbosity.

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?

Given the tool's complexity (a read operation with 2 required parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what 'details' are returned, potential errors, or how it differs from sibling tools. For a tool in this context, more information is needed to be fully helpful to an AI agent.

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?

The input schema has 100% description coverage, with both parameters (docId and repoId) documented as '文档ID (Document ID)' and '知识库ID (Repository ID)'. The description adds no additional meaning beyond what the schema provides, such as format examples or contextual usage. With high schema coverage, the baseline score of 3 is appropriate.

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

Purpose3/5

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

The description '获取文档详情 (Get document details)' states the verb ('get') and resource ('document details'), making the basic purpose clear. However, it's vague about what 'details' include and doesn't distinguish this tool from siblings like 'yuque_get_docs' (which likely lists multiple documents) or 'yuque_search_docs' (which searches documents). It's not tautological but lacks specificity.

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 is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., needing a specific docId and repoId), exclusions, or comparisons to siblings like 'yuque_get_docs' (for lists) or 'yuque_search_docs' (for searching). Usage is implied by the name but not explicitly stated.

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