list-forms
Retrieve all available review forms for human approval workflows. Use this tool after fetching form schemas to manage and access review templates effectively.
Instructions
List all available review forms. NOTE: You need to fetch the schema for the form fields first using the get-form-schema tool.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}
Implementation Reference
- src/index.ts:25-51 (handler)The handler function for the 'list-forms' tool. It creates a GotoHuman instance and fetches the list of available review forms using fetchReviewForms(), returning a JSON-formatted response with the forms or an error.async () => { try { const gotoHuman = new GotoHuman({origin: "mcp-server", originV: version}); const forms = await gotoHuman.fetchReviewForms(); return { content: [{ type: "text", text: JSON.stringify({ success: true, forms: forms }) }] }; } 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:21-52 (registration)Registration of the 'list-forms' tool using server.tool(), including the tool name, description, empty input schema, and inline handler function.server.tool( "list-forms", "List all available review forms. NOTE: You need to fetch the schema for the form fields first using the get-form-schema tool.", {}, async () => { try { const gotoHuman = new GotoHuman({origin: "mcp-server", originV: version}); const forms = await gotoHuman.fetchReviewForms(); return { content: [{ type: "text", text: JSON.stringify({ success: true, forms: forms }) }] }; } 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:24-24 (schema)Empty input schema (no parameters required) for the 'list-forms' tool.{},