Skip to main content
Glama
cheungxin

JianDaoYun MCP Server

by cheungxin

delete_form_data

Remove specific or multiple form data entries in JianDaoYun MCP Server by specifying app ID, form ID, and data IDs. Supports optional automation triggering for streamlined workflows.

Instructions

Delete one or more form data entries

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appIdYesThe JianDaoYun application ID
appKeyNoThe JianDaoYun application key (API key) (optional, will use JIANDAOYUN_APP_KEY from environment if not provided)
dataIdsYesData ID(s) to delete
formIdYesThe form ID (can be form ID or app ID)
isStartTriggerNoWhether to trigger automation

Implementation Reference

  • MCP tool handler that processes the delete_form_data tool call: validates inputs, resolves form ID, invokes the client method, formats and returns the response or error.
    case 'delete_form_data': { const { formId, dataIds, isStartTrigger } = args as { formId: string; dataIds: string | string[]; isStartTrigger?: boolean; }; const { appId, appKey, baseUrl } = getDefaultParams(args); // 验证必需参数 if (!appKey) { throw new Error('appKey is required. Please set JIANDAOYUN_APP_KEY in MCP server configuration.'); } if (!appId) { throw new Error('appId is required. Please provide it as parameter.'); } try { // 创建客户端实例 const jdyClient = new JianDaoYunClient({ appId, appKey, baseUrl }); const resolved = await resolveFormId(formId, appKey); const result = await jdyClient.deleteFormData(resolved.formId, dataIds, { isStartTrigger, }); return { content: [ { type: 'text', text: JSON.stringify({ success: true, result, message: `成功删除 ${Array.isArray(dataIds) ? dataIds.length : 1} 条记录`, formUsed: resolved.formId, appId: resolved.appId || appId }, null, 2), }, ], }; } catch (error) { throw createEnhancedError(error, '删除表单数据'); } }
  • Tool definition including name, description, and input schema for validation.
    name: 'delete_form_data', description: 'Delete one or more form data entries', inputSchema: { type: 'object', properties: { appId: { type: 'string', description: 'The JianDaoYun application ID', }, appKey: { type: 'string', description: 'The JianDaoYun application key (API key) (optional, will use JIANDAOYUN_APP_KEY from environment if not provided)', }, formId: { type: 'string', description: 'The form ID (can be form ID or app ID)', }, dataIds: { type: ['string', 'array'], description: 'Data ID(s) to delete', items: { type: 'string' }, }, isStartTrigger: { type: 'boolean', description: 'Whether to trigger automation', }, }, required: ['appId', 'formId', 'dataIds'], }, },
  • src/index.ts:506-507 (registration)
    The tools array registration where delete_form_data is included in server.setTools.
    ], };
  • JianDaoYunClient method implementing the delete API call, handling single or batch deletion via appropriate endpoints.
    async deleteFormData(formId: string, dataId: string | string[], options?: { isStartTrigger?: boolean }): Promise<any> { try { const isMultiple = Array.isArray(dataId); const endpoint = isMultiple ? '/v5/app/entry/data/batch_delete' : '/v5/app/entry/data/delete'; const requestData: any = { app_id: this.config.appId, entry_id: formId }; if (isMultiple) { requestData.data_ids = dataId; } else { requestData.data_id = dataId; } if (options?.isStartTrigger !== undefined) { requestData.is_start_trigger = options.isStartTrigger; } const response = await this.axios.post<ApiResponse>(endpoint, requestData); if (response.data.code !== 0) { throw new Error(`Failed to delete form data: ${response.data.msg}`); } return response.data.data; } catch (error) { if (axios.isAxiosError(error)) { throw new Error(`API request failed: ${error.response?.data?.msg || error.message}`); } throw error; } }

Other Tools

Related 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/cheungxin/jiandaoyun-mcp-server'

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