Skip to main content
Glama

apipost_create_folder

Create API documentation folders to organize endpoints and resources within the ApiPost MCP server. Specify parent directories and add descriptions for structured project management.

Instructions

创建API文档目录,支持在指定父目录下创建新的文件夹

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes目录名称
parent_idNo父目录ID,使用"0"表示根目录,默认为"0"
descriptionNo目录描述(可选)

Implementation Reference

  • src/index.ts:868-881 (registration)
    Registration of the 'apipost_create_folder' tool in the MCP server's ListTools handler, including its description and input schema.
    {
        name: 'apipost_create_folder',
        description: '创建API文档目录,支持在指定父目录下创建新的文件夹',
        inputSchema: {
            type: 'object',
            properties: {
                name: { type: 'string', description: '目录名称' },
                parent_id: { type: 'string', description: '父目录ID,使用"0"表示根目录,默认为"0"' },
                description: { type: 'string', description: '目录描述(可选)' }
            },
            required: ['name'],
            additionalProperties: false
        }
    },
  • The execution handler for the 'apipost_create_folder' tool. Validates inputs, constructs a folder template object, performs security check, and creates the folder via API POST request to /open/apis/create endpoint.
    case 'apipost_create_folder':
        if (!checkSecurityPermission('write')) {
            throw new Error(`🔒 安全模式 "${APIPOST_SECURITY_MODE}" 不允许创建操作。需要 "limited" 或 "full" 模式。`);
        }
        const folderName = args.name;
        const folderParentId = args.parent_id || '0';
        const folderDescription = args.description || '';
        if (!folderName) {
            throw new Error('请提供目录名称');
        }
        // 生成目录模板
        const folderTemplate = {
            project_id: currentWorkspace.projectId,
            target_id: generateId(),
            parent_id: folderParentId,
            target_type: 'folder',
            name: folderName,
            sort: 0,
            version: 0,
            server_id: '0',
            status: 1,
            is_changed: 1,
            is_create: 1,
            description: folderDescription,
            request: {
                header: { parameter: [] },
                query: { parameter: [] },
                body: { parameter: [] },
                cookie: { parameter: [] },
                auth: {
                    type: 'inherit',
                    kv: { key: '', value: '', in: 'header' },
                    bearer: { key: '' },
                    basic: { username: '', password: '' },
                    digest: {
                        username: '',
                        password: '',
                        realm: '',
                        nonce: '',
                        algorithm: 'MD5',
                        qop: '',
                        nc: '',
                        cnonce: '',
                        opaque: '',
                        disableRetryRequest: false
                    },
                    oauth1: {
                        consumerKey: '',
                        consumerSecret: '',
                        signatureMethod: 'HMAC-SHA1',
                        addEmptyParamsToSign: true,
                        includeBodyHash: true,
                        addParamsToHeader: false,
                        realm: '',
                        version: '1.0',
                        nonce: '',
                        timestamp: '',
                        verifier: '',
                        callback: '',
                        tokenSecret: '',
                        token: '',
                        disableHeaderEncoding: false
                    },
                    hawk: {
                        authId: '',
                        authKey: '',
                        algorithm: '',
                        user: '',
                        nonce: '',
                        extraData: '',
                        app: '',
                        delegation: '',
                        timestamp: '',
                        includePayloadHash: false
                    },
                    awsv4: {
                        accessKey: '',
                        secretKey: '',
                        region: '',
                        service: '',
                        sessionToken: '',
                        addAuthDataToQuery: false
                    },
                    ntlm: {
                        username: '',
                        password: '',
                        domain: '',
                        workstation: '',
                        disableRetryRequest: false
                    },
                    edgegrid: {
                        accessToken: '',
                        clientToken: '',
                        clientSecret: '',
                        nonce: '',
                        timestamp: '',
                        baseURi: '',
                        headersToSign: ''
                    },
                    noauth: {},
                    jwt: {
                        addTokenTo: 'header',
                        algorithm: 'HS256',
                        secret: '',
                        isSecretBase64Encoded: false,
                        payload: '',
                        headerPrefix: 'Bearer',
                        queryParamKey: 'token',
                        header: ''
                    },
                    asap: {
                        alg: 'HS256',
                        iss: '',
                        aud: '',
                        kid: '',
                        privateKey: '',
                        sub: '',
                        claims: '',
                        exp: ''
                    }
                },
                pre_tasks: [],
                post_tasks: []
            },
            is_force: -1,
            is_deleted: -1,
            is_conflicted: -1,
            mark_id: '1'
        };
        // 创建目录
        const createFolderResult = await apiClient.post('/open/apis/create', folderTemplate);
        if (createFolderResult.data.code !== 0) {
            throw new Error(`创建目录失败: ${createFolderResult.data.msg}`);
        }
    
        return {
            content: [{
                    type: 'text',
                    text: `目录创建成功!\n名称: ${folderName}\n目录ID: ${folderTemplate.target_id}\n父目录ID: ${folderParentId}${folderDescription ? '\n描述: ' + folderDescription : ''}`
                }]
        };
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool creates folders, implying a write/mutation operation, but fails to disclose critical behavioral traits: required permissions, whether creation is idempotent, error handling (e.g., duplicate names), rate limits, or what happens on success/failure. The description is basic and leaves the agent guessing about operational risks.

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

Conciseness5/5

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

The description is a single, efficient sentence in Chinese that directly states the tool's purpose and key capability (parent directory support). It is front-loaded with the main action and wastes no words, making it easy for an AI agent to parse quickly.

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 write operation with 3 parameters) and lack of annotations and output schema, the description is incomplete. It doesn't cover behavioral aspects like permissions or errors, output format, or usage context. For a mutation tool with no structured safety hints, this leaves significant gaps for an AI agent to operate safely and effectively.

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%, with clear parameter descriptions in the schema itself. The description adds no additional semantic meaning beyond what the schema provides (e.g., no examples, format details, or constraints). With high schema coverage, the baseline is 3, as the description doesn't compensate but also doesn't detract.

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 action ('创建API文档目录' - create API documentation directory) and resource (folder/directory), with the specific capability to create under a parent directory. It distinguishes from siblings like 'apipost_delete' (deletion) and 'apipost_list' (listing), though not explicitly named. It loses a point for not explicitly contrasting with 'apipost_smart_create' which might have overlapping functionality.

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 minimal guidance: it mentions creating folders under a parent directory, but offers no explicit when-to-use advice, no prerequisites (e.g., authentication needs), no exclusions (e.g., when not to use it), and no alternatives (e.g., vs. 'apipost_smart_create'). Usage is implied by the action, but lacks actionable context for an AI agent.

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/jlcodes99/apipost-mcp'

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