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

Function validateInput

src/tools/WebSearchTool/WebSearchTool.ts:293–311  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

291 return ''
292 },
293 async validateInput(input) {
294 const { query, allowed_domains, blocked_domains } = input
295 if (!query.length) {
296 return {
297 result: false,
298 message: 'Error: Missing query',
299 errorCode: 1,
300 }
301 }
302 if (allowed_domains?.length && blocked_domains?.length) {
303 return {
304 result: false,
305 message:
306 'Error: Cannot specify both allowed_domains and blocked_domains in the same request',
307 errorCode: 2,
308 }
309 }
310 return { result: true }
311 },
312 async call(input, context, _canUseTool, _parentMessage, onProgress) {
313 if (getAPIProvider() === 'firstParty' && getNoumenaBaseUrl()) {
314 return {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected