MCPcopy Create free account
hub / github.com/Noumena-Network/code / validateInput

Function validateInput

src/tools/AskUserQuestionTool/AskUserQuestionTool.tsx:158–181  ·  view source on GitHub ↗
({
    questions
  })

Source from the content-addressed store, hash-verified

156 return true;
157 },
158 async validateInput({
159 questions
160 }) {
161 if (getQuestionPreviewFormat() !== 'html') {
162 return {
163 result: true
164 };
165 }
166 for (const q of questions) {
167 for (const opt of q.options) {
168 const err = validateHtmlPreview(opt.preview);
169 if (err) {
170 return {
171 result: false,
172 message: `Option "${opt.label}" in question "${q.question}": ${err}`,
173 errorCode: 1
174 };
175 }
176 }
177 }
178 return {
179 result: true
180 };
181 },
182 async checkPermissions(input) {
183 return {
184 behavior: 'ask' as const,

Callers

nothing calls this directly

Calls 2

getQuestionPreviewFormatFunction · 0.85
validateHtmlPreviewFunction · 0.85

Tested by

no test coverage detected