Skip to main content
Glama
cheungxin

JianDaoYun MCP Server

by cheungxin

get_form_data

Retrieve a specific data entry from a JianDaoYun form using app ID, form ID, and data entry ID for accurate form data management and integration.

Instructions

Get a specific data entry from a JianDaoYun form

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)
dataIdYesThe data entry ID
formIdYesThe form ID (can be form ID or app ID)

Implementation Reference

  • src/index.ts:304-329 (registration)
    Registration of the 'get_form_data' tool, including name, description, and input schema definition.
    { name: 'get_form_data', description: 'Get a specific data entry from a JianDaoYun form', 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', }, }, required: ['appId', 'formId', 'dataId'], }, },
  • The handler function for the 'get_form_data' tool that validates input, resolves the form ID, creates a JianDaoYunClient instance, fetches the data, and formats the response.
    case 'get_form_data': { const { formId, dataId } = args as { formId: string; dataId: string }; 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 data = await jdyClient.getFormData(resolved.formId, dataId); return { content: [ { type: 'text', text: JSON.stringify({ data, formUsed: resolved.formId, appId: resolved.appId || appId }, null, 2), }, ], }; } catch (error) { throw createEnhancedError(error, '获取表单数据'); } }
  • Helper method in JianDaoYunClient that performs the actual API call to retrieve form data from JianDaoYun.
    async getFormData(formId: string, dataId: string): Promise<any> { try { const response = await this.axios.post<ApiResponse>('/v5/app/entry/data/get', { app_id: this.config.appId, entry_id: formId, data_id: dataId }); if (response.data.code !== 0) { throw new Error(`Failed to get 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