Skip to main content
Glama

yuque_create_repo

Create a knowledge repository on the Yuque platform by specifying name, description, and visibility settings to organize and manage documentation.

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 executes the yuque_create_repo tool logic, calling YuqueClient.createRepo and returning the result as JSON content.
    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), }, ], }; }
  • The schema definition for the yuque_create_repo tool, including input parameters validation and description.
    { 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:46-50 (registration)
    Tool registration point where all YUQUE_TOOLS (including yuque_create_repo) are provided to the MCP server via ListToolsRequestHandler.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: YUQUE_TOOLS, }; });
  • Supporting utility in YuqueClient that performs the actual API call to create a repository, used 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