dev-mcps/browser-mcp/src/tool-definitions.js

46 lines
2.4 KiB
JavaScript

const selector = { type: "string", minLength: 1, maxLength: 1024, description: "CSS selector. The first matching element is used." };
const timeout = { type: "integer", minimum: 100, maximum: 30000, default: 15000 };
export const TOOL_DEFINITIONS = [
{
name: "browser_navigate",
description: "Navigate to an HTTP(S) URL whose exact origin is on the operator allowlist.",
inputSchema: { type: "object", properties: { url: { type: "string", minLength: 1, maxLength: 4096 }, timeoutMs: timeout }, required: ["url"], additionalProperties: false }
},
{
name: "browser_click",
description: "Click the first element matching a CSS selector. Arbitrary page JavaScript is not supported.",
inputSchema: { type: "object", properties: { selector, timeoutMs: timeout }, required: ["selector"], additionalProperties: false }
},
{
name: "browser_fill",
description: "Fill the first form control matching a CSS selector.",
inputSchema: { type: "object", properties: { selector, value: { type: "string", minLength: 1, maxLength: 10000 }, timeoutMs: timeout }, required: ["selector", "value"], additionalProperties: false }
},
{
name: "browser_wait",
description: "Wait briefly for asynchronous page behavior.",
inputSchema: { type: "object", properties: { milliseconds: { type: "integer", minimum: 1, maximum: 5000, default: 500 } }, additionalProperties: false }
},
{
name: "browser_snapshot",
description: "Return bounded visible text and metadata for interactive elements. Input values and arbitrary HTML are not returned.",
inputSchema: { type: "object", properties: { maxTextCharacters: { type: "integer", minimum: 1000, maximum: 100000, default: 50000 } }, additionalProperties: false }
},
{
name: "browser_screenshot",
description: "Capture the current page as a bounded PNG image.",
inputSchema: { type: "object", properties: { fullPage: { type: "boolean", default: false } }, additionalProperties: false }
},
{
name: "browser_console_messages",
description: "Read bounded browser console and page-error messages.",
inputSchema: { type: "object", properties: { clear: { type: "boolean", default: false } }, additionalProperties: false }
},
{
name: "browser_network_errors",
description: "Read bounded failed requests and HTTP error responses.",
inputSchema: { type: "object", properties: { clear: { type: "boolean", default: false } }, additionalProperties: false }
}
];