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;
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is an update operation (implying mutation) but doesn't mention permissions required, whether changes are reversible, rate limits, error handling, or what happens to existing data not included in the update. This is a significant gap for a mutation tool.

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 that states the core purpose without unnecessary words. It's appropriately sized and front-loaded with the essential information.

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?

For a mutation tool with 7 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what happens after the update, what the response looks like, error conditions, or how this differs from similar tools. The agent would need to guess about important behavioral aspects.

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%, so all parameters are documented in the schema. The description adds no additional parameter information beyond what's already in the schema (e.g., it doesn't explain the relationship between appId and formId, or what format 'data' should be in). Baseline 3 is appropriate when the schema does the heavy lifting.

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 verb ('Update') and resource ('an existing form data entry'), making the purpose understandable. However, it doesn't differentiate this tool from its sibling 'submit_form_data' which might also involve form data modification, leaving some ambiguity about when to use one versus the other.

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 no guidance on when to use this tool versus alternatives like 'submit_form_data' or 'delete_form_data'. It mentions no prerequisites, constraints, or typical use cases, leaving the agent to infer usage from context alone.

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

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