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 }]
        };
Behavior3/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. It discloses that the tool performs deletion ('删除'), which implies a destructive mutation, and mentions it supports batch operations ('批量删除', '支持单个或多个接口删除'). However, it lacks details on permissions required, whether deletions are reversible, error handling, or rate limits. For a destructive tool with zero annotation coverage, this is a moderate gap, but the description at least clarifies the batch nature.

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 highly concise and front-loaded: the first sentence states the core action and scope ('批量删除API接口文档,支持单个或多个接口删除'), and the second sentence provides essential usage guidance. Every sentence earns its place with no wasted words, making it efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (destructive mutation with batch support), no annotations, no output schema, and 100% schema coverage, the description is moderately complete. It covers the purpose, usage prerequisites, and parameter basics, but lacks behavioral details like side effects, permissions, or return values. For a deletion tool, this leaves gaps in understanding the full impact, though the core functionality is clear.

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 the parameter 'api_ids' fully documented in the schema as an array of strings for API interface IDs. The description adds minimal value beyond the schema: it reiterates that IDs can be obtained from apipost_list and supports single or multiple IDs, which is already covered in the schema description. Since schema coverage is high, the baseline is 3, and the description doesn't significantly enhance parameter understanding.

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 tool's purpose: '批量删除API接口文档' (batch delete API interface documents) with the specific action '删除' (delete) on the resource 'API接口文档' (API interface documents). It distinguishes from siblings like apipost_list (view) and apipost_update (modify), though it doesn't explicitly name alternatives. The purpose is specific but could be slightly more differentiated from other destructive operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool: '删除前先用apipost_list查看接口列表获取ID' (before deleting, first use apipost_list to view the interface list and get IDs). This gives a prerequisite step and implicitly distinguishes from apipost_list (for viewing) and apipost_detail (for details). However, it doesn't explicitly state when NOT to use it or name all alternatives (e.g., vs. apipost_update for modifications).

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