MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / execute

Method execute

src/tools/browser/tools.ts:222–239  ·  view source on GitHub ↗
(args: z.infer<typeof ConsoleArgs>, _ctx: ToolContext)

Source from the content-addressed store, hash-verified

220 argsSchema = ConsoleArgs;
221
222 async execute(args: z.infer<typeof ConsoleArgs>, _ctx: ToolContext): Promise<ToolResult> {
223 const s = await getSession();
224 const level = args.level ?? 'all';
225 const limit = args.limit ?? 50;
226 const filtered = level === 'all'
227 ? s.consoleBuffer
228 : s.consoleBuffer.filter(m => m.type === level);
229 const slice = filtered.slice(-limit);
230 const consoleLines = slice.length === 0
231 ? ' (no messages)'
232 : slice.map(m => ` [${m.type}] ${m.text}${m.location ? ` (${m.location})` : ''}`).join('\n');
233 const errors = s.errorBuffer.length === 0
234 ? ' (no page errors)'
235 : s.errorBuffer.map(e => ` ${e.message}`).join('\n');
236 return {
237 content: `Console (${slice.length}/${filtered.length} ${level} message(s)):\n${consoleLines}\n\nPage errors (${s.errorBuffer.length}):\n${errors}`,
238 };
239 }
240}
241
242const EvaluateArgs = z.object({

Callers

nothing calls this directly

Calls 1

getSessionFunction · 0.85

Tested by

no test coverage detected