Skip to main content
Glama

yuque_create_repo

Create a knowledge repository on Yuque platform to organize and manage documents. Specify repository name, optional description, and visibility settings to establish structured documentation space.

Instructions

创建知识库 (Create knowledge repository)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes知识库名称 (Repository name)
descriptionNo知识库描述,可选 (Repository description, optional)
isPublicNo是否公开,默认false (Whether public, default false)

Implementation Reference

  • The handler function that processes the yuque_create_repo tool call, extracts arguments, invokes YuqueClient.createRepo, and returns the formatted response.
    async function handleCreateRepo( client: YuqueClient, args: { name: string; description?: string; isPublic?: boolean; } ) { const repo = await client.createRepo( args.name, args.description, args.isPublic || false ); return { content: [ { type: 'text', text: JSON.stringify(repo, null, 2), }, ], }; }
  • Tool schema defining the name, description, and input validation schema for yuque_create_repo.
    { name: 'yuque_create_repo', description: '创建知识库 (Create knowledge repository)', inputSchema: { type: 'object', properties: { name: { type: 'string', description: '知识库名称 (Repository name)', minLength: 1, maxLength: 100, }, description: { type: 'string', description: '知识库描述,可选 (Repository description, optional)', maxLength: 500, }, isPublic: { type: 'boolean', description: '是否公开,默认false (Whether public, default false)', }, }, required: ['name'], }, }, ];
  • src/server.ts:45-67 (registration)
    MCP server registration of tool list handler (returns YUQUE_TOOLS including yuque_create_repo) and tool call handler (dispatches to handleTool).
    // Handle tool listing requests server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: YUQUE_TOOLS, }; }); // Handle tool execution requests server.setRequestHandler(CallToolRequestSchema, async (request) => { try { return await handleTool(request, { client: yuqueClient }); } catch (error) { if (error instanceof McpError) { throw error; } const errorMessage = error instanceof Error ? error.message : String(error); throw new McpError( ErrorCode.InternalError, `Error executing tool: ${errorMessage}` ); } });
  • YuqueClient method that performs the actual API call to create a repository, called by the tool handler.
    async createRepo( name: string, description?: string, isPublic: boolean = false ): Promise<YuqueRepo> { const slug = this.generateSlug(name); // Get current user ID for repository creation const user = await this.getUser(); const userId = user.id; return this.request<YuqueRepo>(`/users/${userId}/repos`, { method: 'POST', data: { name, slug, description: description || '', public: isPublic ? 1 : 0, type: 'Book', }, }); }

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