request-human-review-with-form
Initiate a human review process by submitting form data to the gotoHuman MCP server. Use a form ID and dynamically fetched schema to structure field data, optionally add metadata, and assign specific reviewers.
Instructions
Request a human review with a form. NOTE: If you don't have a form ID yet, list all available forms using the list-forms tool first. To know what to pass for fieldData, you need to fetch the schema for the form fields using the get-form-schema tool.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assignToUsers | No | Optional list of user emails to assign the review to | |
| fieldData | Yes | The field data to include in the review request. Note that this is a dynamic schema that you need to fetch first using the get-form-schema tool. | |
| formId | Yes | The form ID to request a human review for | |
| metadata | No | Optional additional data that will be incl. in the webhook response after form submission. Incl. everything required to proceed with your workflow. |
Implementation Reference
- src/index.ts:104-150 (handler)The handler function that implements the core logic for the 'request-human-review-with-form' tool. It creates a review request using GotoHuman, adds field data, metadata, and assignees, sends the request, and returns the review ID and link.async ({ formId, fieldData, metadata, assignToUsers }) => { try { const gotoHuman = new GotoHuman(); const reviewRequest = gotoHuman.createReview(formId); // Add all field data dynamically Object.entries(fieldData).forEach(([key, value]) => { reviewRequest.addFieldData(key, value); }); // Add optional metadata if provided if (metadata) { Object.entries(metadata).forEach(([key, value]) => { reviewRequest.addMetaData(key, value); }); } // Assign to specific users if provided if (assignToUsers) { reviewRequest.assignToUsers(assignToUsers); } const response = await reviewRequest.sendRequest(); return { content: [{ type: "text", text: JSON.stringify({ success: true, reviewId: response.reviewId, reviewLink: response.gthLink }) }] }; } catch (error) { return { content: [{ type: "text", text: JSON.stringify({ success: false, error: error instanceof Error ? error.message : "Unknown error occurred" }) }], isError: true }; } }
- src/index.ts:92-97 (schema)Zod schema defining the input parameters for the 'request-human-review-with-form' tool, including formId, fieldData, optional metadata, and optional assignToUsers.const requestHumanReviewSchema = { formId: z.string().describe("The form ID to request a human review for"), fieldData: z.record(z.string(), z.any()).describe("The field data to include in the review request. Note that this is a dynamic schema that you need to fetch first using the get-form-schema tool."), metadata: z.record(z.string(), z.string()).optional().describe("Optional additional data that will be incl. in the webhook response after form submission. Incl. everything required to proceed with your workflow."), assignToUsers: z.array(z.string()).optional().describe("Optional list of user emails to assign the review to") };
- src/index.ts:100-151 (registration)MCP server tool registration for 'request-human-review-with-form', specifying the tool name, description, input schema, and handler function.server.tool( "request-human-review-with-form", "Request a human review with a form. NOTE: If you don't have a form ID yet, list all available forms using the list-forms tool first. To know what to pass for fieldData, you need to fetch the schema for the form fields using the get-form-schema tool.", requestHumanReviewSchema, async ({ formId, fieldData, metadata, assignToUsers }) => { try { const gotoHuman = new GotoHuman(); const reviewRequest = gotoHuman.createReview(formId); // Add all field data dynamically Object.entries(fieldData).forEach(([key, value]) => { reviewRequest.addFieldData(key, value); }); // Add optional metadata if provided if (metadata) { Object.entries(metadata).forEach(([key, value]) => { reviewRequest.addMetaData(key, value); }); } // Assign to specific users if provided if (assignToUsers) { reviewRequest.assignToUsers(assignToUsers); } const response = await reviewRequest.sendRequest(); return { content: [{ type: "text", text: JSON.stringify({ success: true, reviewId: response.reviewId, reviewLink: response.gthLink }) }] }; } catch (error) { return { content: [{ type: "text", text: JSON.stringify({ success: false, error: error instanceof Error ? error.message : "Unknown error occurred" }) }], isError: true }; } } );