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

Function validateInput

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

Source from the content-addressed store, hash-verified

233 return ''
234 },
235 async validateInput(input) {
236 const { query, allowed_domains, blocked_domains } = input
237 if (!query.length) {
238 return {
239 result: false,
240 message: 'Error: Missing query',
241 errorCode: 1,
242 }
243 }
244 if (allowed_domains?.length && blocked_domains?.length) {
245 return {
246 result: false,
247 message:
248 'Error: Cannot specify both allowed_domains and blocked_domains in the same request',
249 errorCode: 2,
250 }
251 }
252 return { result: true }
253 },
254 async call(input, context, _canUseTool, _parentMessage, onProgress) {
255 const startTime = performance.now()
256 const { query } = input

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected