Skip to main content
Glama

apipost_delete

Remove API documentation entries from ApiPost MCP server by specifying API IDs. Delete single or multiple interfaces after reviewing with apipost_list to obtain required identifiers.

Instructions

批量删除API接口文档,支持单个或多个接口删除。删除前先用apipost_list查看接口列表获取ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_idsYesAPI接口ID数组(可从列表中获取target_id)- 支持单个["id1"]或多个["id1","id2","id3"]

Implementation Reference

  • src/index.ts:957-971 (registration)
    Registration of the 'apipost_delete' tool in the MCP server tools list, including name, description, and input schema.
    {
        name: 'apipost_delete',
        description: '批量删除API接口文档,支持单个或多个接口删除。删除前先用apipost_list查看接口列表获取ID',
        inputSchema: {
            type: 'object',
            properties: {
                api_ids: {
                    type: 'array',
                    items: { type: 'string' },
                    description: 'API接口ID数组(可从列表中获取target_id)- 支持单个["id1"]或多个["id1","id2","id3"]'
                }
            },
            required: ['api_ids']
        }
    }
  • Handler implementation for the 'apipost_delete' tool. Checks permissions, validates input, calls ApiPost delete API, and returns confirmation.
    case 'apipost_delete':
        if (!checkSecurityPermission('delete')) {
            throw new Error(`🔒 安全模式 "${APIPOST_SECURITY_MODE}" 不允许删除操作。需要 "full" 模式。`);
        }
        const apiIds = args.api_ids;
        if (!apiIds || !Array.isArray(apiIds) || apiIds.length === 0) {
            throw new Error('请提供要删除的API接口ID数组');
        }
        const deleteData = {
            project_id: currentWorkspace.projectId,
            target_ids: apiIds
        };
        const deleteResult = await apiClient.post('/open/apis/delete', deleteData);
        if (deleteResult.data.code !== 0) {
            throw new Error(`删除失败: ${deleteResult.data.msg}`);
        }
    
        let deleteText = `批量删除完成!\n删除数量: ${apiIds.length} 个接口\n删除的ID:\n`;
        apiIds.forEach((id, index) => {
            deleteText += `${index + 1}. ${id}\n`;
        });
        return {
            content: [{ type: 'text', text: deleteText }]
        };

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