MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / buildInputSchema

Function buildInputSchema

packages/server/src/services/mcp-endpoint/index.ts:67–75  ·  view source on GitHub ↗

* Build the zod input schema parameters for the tool. * For chatflows: always has a mandatory `question` string. * For agentflows: only allow one of `question` or `form` (object)

(chatflow: ChatFlow)

Source from the content-addressed store, hash-verified

65 * For agentflows: only allow one of `question` or `form` (object)
66 */
67function buildInputSchema(chatflow: ChatFlow) {
68 const inputType = getToolInputType(chatflow)
69 if (inputType === 'form') {
70 return buildFormInputSchema(chatflow)
71 }
72 return {
73 question: z.string().describe('The question or prompt to send to the chatflow')
74 }
75}
76
77/**
78 * Build the zod schema for form input, based on the `startAgentflow` node configuration.

Callers 1

handleMcpRequestFunction · 0.85

Calls 2

getToolInputTypeFunction · 0.85
buildFormInputSchemaFunction · 0.85

Tested by

no test coverage detected