Skip to main content
Glama
cheungxin

JianDaoYun MCP Server

by cheungxin

update_form_data

Modify existing form entries in JianDaoYun applications by providing the form ID, entry ID, and updated data values.

Instructions

Update an existing form data entry

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)
formIdYesThe form ID (can be form ID or app ID)
dataIdYesThe data entry ID to update
dataYesThe data to update
transactionIdNoOptional transaction ID
isStartTriggerNoWhether to trigger automation

Implementation Reference

  • src/index.ts:393-430 (registration)
    Registration of the 'update_form_data' tool including its input schema definition
    { name: 'update_form_data', description: 'Update an existing form data entry', 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)', }, dataId: { type: 'string', description: 'The data entry ID to update', }, data: { type: 'object', description: 'The data to update', }, transactionId: { type: 'string', description: 'Optional transaction ID', }, isStartTrigger: { type: 'boolean', description: 'Whether to trigger automation', }, }, required: ['appId', 'formId', 'dataId', 'data'], }, },
  • MCP dispatch handler for 'update_form_data': validates params, resolves form ID, creates JianDaoYunClient, calls updateFormData, returns result
    case 'update_form_data': { const { formId, dataId, data, transactionId, isStartTrigger } = args as { formId: string; dataId: string; data: FormData; transactionId?: 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.updateFormData(resolved.formId, dataId, data, { transactionId, isStartTrigger, }); return { content: [ { type: 'text', text: JSON.stringify({ success: true, result, message: '数据更新成功', formUsed: resolved.formId, appId: resolved.appId || appId }, null, 2), }, ], }; } catch (error) { throw createEnhancedError(error, '更新表单数据'); } }
  • Core API client method: formats the update data using formatDataForSubmission and performs POST request to JianDaoYun /v5/app/entry/data/update endpoint
    async updateFormData(formId: string, dataId: string, data: FormData, options?: { transactionId?: string; isStartTrigger?: boolean }): Promise<any> { try { const requestData: any = { app_id: this.config.appId, entry_id: formId, data_id: dataId, data: this.formatDataForSubmission(data) }; if (options?.transactionId) { requestData.transaction_id = options.transactionId; } if (options?.isStartTrigger !== undefined) { requestData.is_start_trigger = options.isStartTrigger; } const response = await this.axios.post<ApiResponse>('/v5/app/entry/data/update', requestData); if (response.data.code !== 0) { throw new Error(`Failed to update 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; } }

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