@visualsentinel/mcp-server 0.1.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/README.md +54 -7
- package/dist/.metadata_never_index +0 -0
- package/dist/api-client.d.ts +32 -0
- package/dist/api-client.js +79 -0
- package/dist/api-client.js.map +1 -0
- package/dist/index.js +457 -16
- package/dist/index.js.map +1 -1
- package/dist/prompts.d.ts +22 -0
- package/dist/prompts.js +105 -0
- package/dist/prompts.js.map +1 -0
- package/dist/resources.d.ts +18 -0
- package/dist/resources.js +625 -0
- package/dist/resources.js.map +1 -0
- package/dist/tools.d.ts +38 -0
- package/dist/tools.js +546 -0
- package/dist/tools.js.map +1 -0
- package/dist/version.d.ts +4 -0
- package/dist/version.js +8 -0
- package/dist/version.js.map +1 -0
- package/package.json +15 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tools.ts","../src/resources.ts"],"sourcesContent":["/**\n * Tool registry for the Visual Sentinel MCP server.\n *\n * Each tool wraps a single Visual Sentinel REST endpoint with a JSON Schema\n * input and a structured handler. Public-tool handlers (DNS check, SSL check,\n * speed test, website check, health) run without authentication; everything\n * else requires `VS_API_KEY`.\n */\n\nimport { ApiClient } from './api-client.js';\n\ninterface ToolInput {\n type: 'object';\n properties: Record<string, unknown>;\n required?: string[];\n additionalProperties?: boolean;\n}\n\nexport interface ToolAnnotations {\n title: string;\n readOnlyHint: boolean;\n destructiveHint: boolean;\n idempotentHint: boolean;\n openWorldHint: boolean;\n}\n\nexport interface ToolDefinition {\n name: string;\n /** Human-readable title shown by MCP clients. */\n title: string;\n description: string;\n annotations: ToolAnnotations;\n inputSchema: ToolInput;\n requiresAuth: boolean;\n handler: (args: Record<string, unknown>, client: ApiClient) => Promise<unknown>;\n}\n\nconst STR = { type: 'string' as const };\nconst NUM = { type: 'number' as const };\nconst INT = { type: 'integer' as const };\nconst BOOL = { type: 'boolean' as const };\n\nfunction pickString(args: Record<string, unknown>, key: string): string | undefined {\n const v = args[key];\n return typeof v === 'string' && v.length > 0 ? v : undefined;\n}\n\nfunction pickNumber(args: Record<string, unknown>, key: string): number | undefined {\n const v = args[key];\n return typeof v === 'number' && Number.isFinite(v) ? v : undefined;\n}\n\nfunction requireString(args: Record<string, unknown>, key: string): string {\n const v = pickString(args, key);\n if (!v) throw new Error(`Argument \"${key}\" (string) is required.`);\n return v;\n}\n\nexport const TOOLS: ToolDefinition[] = [\n // -------------------------------------------------------------------------\n // Public tools (no auth)\n // -------------------------------------------------------------------------\n {\n name: 'vs_health',\n title: 'Check Visual Sentinel service health',\n annotations: {\n title: 'Check Visual Sentinel service health',\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n description:\n 'Check whether Visual Sentinel itself is up. Returns the service health status. No authentication required.',\n inputSchema: {\n type: 'object',\n properties: {},\n additionalProperties: false,\n },\n requiresAuth: false,\n handler: async (_args, client) => client.request('GET', '/api/health', { auth: false }),\n },\n\n {\n name: 'vs_dns_check',\n title: 'Look up DNS records',\n annotations: {\n title: 'Look up DNS records',\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n description:\n 'Resolve DNS records (A, AAAA, MX, NS, TXT, CNAME) for a domain using Visual Sentinel\\'s public DNS lookup tool. No authentication required.',\n inputSchema: {\n type: 'object',\n properties: {\n domain: { ...STR, description: 'Domain to resolve, e.g. example.com (without protocol).' },\n recordType: {\n ...STR,\n description: 'Optional: limit to one record type. One of: A, AAAA, MX, NS, TXT, CNAME, SOA. Default: all.',\n },\n },\n required: ['domain'],\n additionalProperties: false,\n },\n requiresAuth: false,\n handler: async (args, client) =>\n client.request('GET', '/api/tools/dns-check', {\n auth: false,\n query: {\n domain: requireString(args, 'domain'),\n // The API reads ?type= (not recordType).\n type: pickString(args, 'recordType'),\n },\n }),\n },\n\n {\n name: 'vs_ssl_check',\n title: 'Inspect an SSL certificate',\n annotations: {\n title: 'Inspect an SSL certificate',\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n description:\n 'Inspect a TLS/SSL certificate for a hostname: issuer, subject, validity dates, SAN list, key algorithm, and certificate chain. No authentication required.',\n inputSchema: {\n type: 'object',\n properties: {\n domain: { ...STR, description: 'Hostname to inspect, e.g. example.com (without protocol).' },\n },\n required: ['domain'],\n additionalProperties: false,\n },\n requiresAuth: false,\n handler: async (args, client) =>\n client.request('GET', '/api/tools/ssl-check', {\n auth: false,\n // The API reads ?domain=. `host` stays as an input alias for 0.1.x callers.\n query: { domain: pickString(args, 'domain') ?? requireString(args, 'host') },\n }),\n },\n\n {\n name: 'vs_speed_test',\n title: 'Run a one-shot speed test',\n annotations: {\n title: 'Run a one-shot speed test',\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n description:\n 'Run a one-shot Lighthouse lab test on a URL. Returns the performance score (0 to 100) plus Largest Contentful Paint, First Contentful Paint, Cumulative Layout Shift, Time to First Byte, Total Blocking Time and Speed Index (times in milliseconds). No account needed.',\n inputSchema: {\n type: 'object',\n properties: {\n url: { ...STR, description: 'Full URL to test, including protocol (https://...).' },\n },\n required: ['url'],\n additionalProperties: false,\n },\n requiresAuth: false,\n handler: async (args, client) =>\n client.request('GET', '/api/tools/speed-test', {\n auth: false,\n query: { url: requireString(args, 'url') },\n }),\n },\n\n {\n name: 'vs_website_check',\n title: 'Check a website',\n annotations: {\n title: 'Check a website',\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n description:\n 'Quick health check for a URL: HTTP status, response time, server header, content snippet, and basic SSL state. No authentication required.',\n inputSchema: {\n type: 'object',\n properties: {\n url: { ...STR, description: 'Full URL to test, including protocol (https://...).' },\n },\n required: ['url'],\n additionalProperties: false,\n },\n requiresAuth: false,\n handler: async (args, client) =>\n client.request('GET', '/api/tools/website-check', {\n auth: false,\n query: { url: requireString(args, 'url') },\n }),\n },\n\n // -------------------------------------------------------------------------\n // Authenticated tools (require VS_API_KEY)\n // -------------------------------------------------------------------------\n {\n name: 'vs_monitors_list',\n title: 'List monitors',\n annotations: {\n title: 'List monitors',\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n description:\n 'List monitors in the authenticated organization. Optional filters narrow by status, type, or paginate.',\n inputSchema: {\n type: 'object',\n properties: {\n status: { ...STR, description: 'Filter: UP, DOWN, PAUSED, MAINTENANCE.' },\n type: {\n ...STR,\n description:\n 'Filter by monitor type: HTTP, HTTPS, KEYWORD, PING, PORT, DNS, SSL, VISUAL, CONTENT, API, GRAPHQL, WEBSOCKET.',\n },\n page: { ...INT, description: 'Page number (default 1).' },\n limit: { ...INT, description: 'Items per page (default 50, max 200).' },\n },\n additionalProperties: false,\n },\n requiresAuth: true,\n handler: async (args, client) =>\n client.request('GET', '/api/monitors', {\n query: {\n status: pickString(args, 'status'),\n type: pickString(args, 'type'),\n page: pickNumber(args, 'page'),\n limit: pickNumber(args, 'limit'),\n },\n }),\n },\n\n {\n name: 'vs_monitors_get',\n title: 'Get a monitor',\n annotations: {\n title: 'Get a monitor',\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n description:\n 'Fetch a single monitor by id, including its current status, last check, and configuration.',\n inputSchema: {\n type: 'object',\n properties: {\n id: { ...STR, description: 'Monitor id (cuid).' },\n },\n required: ['id'],\n additionalProperties: false,\n },\n requiresAuth: true,\n handler: async (args, client) =>\n client.request('GET', `/api/monitors/${encodeURIComponent(requireString(args, 'id'))}`),\n },\n\n {\n name: 'vs_monitors_create',\n title: 'Create a monitor',\n annotations: {\n title: 'Create a monitor',\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: false,\n },\n description:\n 'Create a new monitor. Provide at least name, url, and type. Returns the created monitor including its assigned id.',\n inputSchema: {\n type: 'object',\n properties: {\n name: { ...STR, description: 'Display name for the monitor.' },\n url: { ...STR, description: 'Full URL to monitor (or hostname for PING/PORT/DNS/SSL).' },\n type: {\n ...STR,\n description:\n 'Monitor type: HTTP, HTTPS, KEYWORD, PING, PORT, DNS, SSL, VISUAL, CONTENT, API, GRAPHQL, WEBSOCKET.',\n },\n interval: { ...INT, description: 'Check interval in seconds (60, 300, 600, 1800, 3600).' },\n timeout: { ...INT, description: 'Per-check timeout in seconds (default 30).' },\n method: { ...STR, description: 'HTTP method for HTTP/HTTPS monitors (default GET).' },\n keyword: { ...STR, description: 'Keyword to assert for KEYWORD monitors.' },\n port: { ...INT, description: 'TCP port for PORT monitors.' },\n },\n required: ['name', 'url', 'type'],\n additionalProperties: false,\n },\n requiresAuth: true,\n handler: async (args, client) =>\n client.request('POST', '/api/monitors', {\n body: {\n name: requireString(args, 'name'),\n url: requireString(args, 'url'),\n type: requireString(args, 'type'),\n interval: pickNumber(args, 'interval'),\n timeout: pickNumber(args, 'timeout'),\n method: pickString(args, 'method'),\n keyword: pickString(args, 'keyword'),\n port: pickNumber(args, 'port'),\n },\n }),\n },\n\n {\n name: 'vs_monitors_check_now',\n title: 'Run a monitor check now',\n annotations: {\n title: 'Run a monitor check now',\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: false,\n },\n description:\n 'Trigger an immediate check for a monitor (in addition to its scheduled cadence). Returns the freshly-collected check result.',\n inputSchema: {\n type: 'object',\n properties: {\n id: { ...STR, description: 'Monitor id.' },\n },\n required: ['id'],\n additionalProperties: false,\n },\n requiresAuth: true,\n handler: async (args, client) =>\n client.request('POST', `/api/monitors/${encodeURIComponent(requireString(args, 'id'))}/check`),\n },\n\n {\n name: 'vs_monitors_uptime',\n title: 'Get monitor uptime',\n annotations: {\n title: 'Get monitor uptime',\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n description:\n 'Fetch the uptime percentage and time-series breakdown for a monitor. Use `window` for a preset window (24h, 7d, 30d, 90d, 365d; default 30d), supply both `from` and `to` (ISO 8601) for a custom date range, or set `all: true` for the full available history.',\n inputSchema: {\n type: 'object',\n properties: {\n id: { ...STR, description: 'Monitor id.' },\n window: {\n ...STR,\n description: 'Preset window: 1h, 6h, 24h, 7d, 30d, 90d, 365d. Default 30d. Ignored when from+to or all are supplied.',\n },\n from: {\n ...STR,\n description: 'ISO 8601 start of a custom range (e.g. 2026-01-01T00:00:00Z). Must be supplied with `to`.',\n },\n to: {\n ...STR,\n description: 'ISO 8601 end of a custom range. Must be supplied with `from`.',\n },\n all: {\n type: 'boolean',\n description: 'Return the full available history from the earliest stored data. Takes precedence over from/to and window.',\n },\n },\n required: ['id'],\n additionalProperties: false,\n },\n requiresAuth: true,\n handler: async (args, client) => {\n const from = pickString(args, 'from');\n const to = pickString(args, 'to');\n // Precedence mirrors the API: all > from/to > window/period.\n const query = args['all'] === true\n ? { all: true }\n : (from && to)\n ? { from, to }\n : { period: pickString(args, 'window') ?? '30d' };\n return client.request(\n 'GET',\n `/api/monitors/${encodeURIComponent(requireString(args, 'id'))}/uptime`,\n { query },\n );\n },\n },\n\n {\n name: 'vs_monitors_metrics_bulk',\n title: 'Get bulk monitor metrics',\n annotations: {\n title: 'Get bulk monitor metrics',\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n description:\n 'Fetch uptime or response-time metrics for up to 100 monitors in a single request. Use `window` for a preset window (1h, 6h, 24h, 7d, 30d, 90d, 365d; default 30d), supply both `from` and `to` (ISO 8601) for a custom date range, or set `all: true` for the full available history. Returns a `monitors` object keyed by monitor id.',\n inputSchema: {\n type: 'object',\n properties: {\n monitorIds: {\n type: 'array',\n items: { type: 'string' },\n description: 'List of monitor IDs to fetch metrics for (max 100).',\n },\n metric: {\n ...STR,\n description: 'Metric to return: \"uptime\" or \"response-time\".',\n },\n window: {\n ...STR,\n description: 'Preset window: 1h, 6h, 24h, 7d, 30d, 90d, 365d. Default 30d. Ignored when from+to or all are supplied.',\n },\n from: {\n ...STR,\n description: 'ISO 8601 start of a custom range (e.g. 2026-01-01T00:00:00Z). Must be supplied with `to`.',\n },\n to: {\n ...STR,\n description: 'ISO 8601 end of a custom range. Must be supplied with `from`.',\n },\n all: {\n type: 'boolean',\n description: 'Return the full available history from the earliest stored data. Takes precedence over from/to and window.',\n },\n },\n required: ['monitorIds', 'metric'],\n additionalProperties: false,\n },\n requiresAuth: true,\n handler: async (args, client) => {\n const monitorIds = args['monitorIds'];\n if (!Array.isArray(monitorIds) || monitorIds.length === 0) {\n throw new Error('Argument \"monitorIds\" must be a non-empty array.');\n }\n const from = pickString(args, 'from');\n const to = pickString(args, 'to');\n const body: Record<string, unknown> = {\n monitorIds,\n metric: requireString(args, 'metric'),\n };\n // Precedence mirrors the API: all > from/to > window/period.\n if (args['all'] === true) {\n body['all'] = true;\n } else if (from && to) {\n body['from'] = from;\n body['to'] = to;\n } else {\n body['period'] = pickString(args, 'window') ?? '30d';\n }\n return client.request('POST', '/api/monitors/metrics', { body });\n },\n },\n\n {\n name: 'vs_incidents_list',\n title: 'List incidents',\n annotations: {\n title: 'List incidents',\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n description:\n 'List incidents for the authenticated organization. Filter by status (OPEN/RESOLVED), monitor id, or paginate.',\n inputSchema: {\n type: 'object',\n properties: {\n status: { ...STR, description: 'OPEN or RESOLVED.' },\n monitorId: { ...STR, description: 'Filter to one monitor.' },\n page: { ...INT },\n limit: { ...INT, description: 'Default 50, max 200.' },\n },\n additionalProperties: false,\n },\n requiresAuth: true,\n handler: async (args, client) =>\n client.request('GET', '/api/incidents', {\n query: {\n status: pickString(args, 'status'),\n monitorId: pickString(args, 'monitorId'),\n page: pickNumber(args, 'page'),\n limit: pickNumber(args, 'limit'),\n },\n }),\n },\n\n {\n name: 'vs_incidents_get',\n title: 'Get an incident',\n annotations: {\n title: 'Get an incident',\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n description: 'Fetch a single incident with its full check history and root-cause hints.',\n inputSchema: {\n type: 'object',\n properties: {\n id: { ...STR, description: 'Incident id.' },\n },\n required: ['id'],\n additionalProperties: false,\n },\n requiresAuth: true,\n handler: async (args, client) =>\n client.request('GET', `/api/incidents/${encodeURIComponent(requireString(args, 'id'))}`),\n },\n\n {\n name: 'vs_alerts_list',\n title: 'List alerts',\n annotations: {\n title: 'List alerts',\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n description:\n 'List alerts for the authenticated organization. Filter by status (UNACKNOWLEDGED/ACKNOWLEDGED/RESOLVED) or paginate.',\n inputSchema: {\n type: 'object',\n properties: {\n status: { ...STR, description: 'UNACKNOWLEDGED, ACKNOWLEDGED, or RESOLVED.' },\n page: { ...INT },\n limit: { ...INT, description: 'Default 50, max 200.' },\n },\n additionalProperties: false,\n },\n requiresAuth: true,\n handler: async (args, client) =>\n client.request('GET', '/api/alerts', {\n query: {\n status: pickString(args, 'status'),\n page: pickNumber(args, 'page'),\n limit: pickNumber(args, 'limit'),\n },\n }),\n },\n\n {\n name: 'vs_alerts_acknowledge',\n title: 'Acknowledge an alert',\n annotations: {\n title: 'Acknowledge an alert',\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n description: 'Acknowledge an alert by id. The acknowledgement is recorded against the account that authorised this connection.',\n inputSchema: {\n type: 'object',\n properties: {\n id: { ...STR, description: 'Alert id.' },\n note: { ...STR, description: 'Optional acknowledgement note (visible in alert history).' },\n },\n required: ['id'],\n additionalProperties: false,\n },\n requiresAuth: true,\n handler: async (args, client) =>\n client.request('POST', `/api/alerts/${encodeURIComponent(requireString(args, 'id'))}/acknowledge`, {\n body: { note: pickString(args, 'note') },\n }),\n },\n\n {\n name: 'vs_status_pages_list',\n title: 'List status pages',\n annotations: {\n title: 'List status pages',\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n description: 'List public-facing status pages owned by the authenticated organization.',\n inputSchema: {\n type: 'object',\n properties: {},\n additionalProperties: false,\n },\n requiresAuth: true,\n handler: async (_args, client) => client.request('GET', '/api/status-pages'),\n },\n\n {\n name: 'vs_servers_list',\n title: 'List servers',\n annotations: {\n title: 'List servers',\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n description: 'List servers (origins) registered in the authenticated organization.',\n inputSchema: {\n type: 'object',\n properties: {\n page: { ...INT },\n limit: { ...INT, description: 'Default 50.' },\n },\n additionalProperties: false,\n },\n requiresAuth: true,\n handler: async (args, client) =>\n client.request('GET', '/api/servers', {\n query: { page: pickNumber(args, 'page'), limit: pickNumber(args, 'limit') },\n }),\n },\n];\n\nexport function findTool(name: string): ToolDefinition | undefined {\n return TOOLS.find((t) => t.name === name);\n}\n\n// Suppress unused-warning suppression: BOOL/NUM are reserved for future tools.\nvoid BOOL;\nvoid NUM;\n","/**\n * MCP resources: read-only reference material the assistant can attach as\n * context. Static on purpose, so they work without an API key and never touch\n * account data. Plan limits come from the public pricing page; check\n * https://visualsentinel.com/pricing for current prices.\n */\n\nimport { TOOLS } from './tools.js';\n\nexport interface ResourceDefinition {\n uri: string;\n name: string;\n title: string;\n description: string;\n mimeType: string;\n read: () => string;\n}\n\nconst PLANS_AS_OF = '2026-10-16';\n\nconst PLANS = `# Visual Sentinel plans and limits (as of ${PLANS_AS_OF})\n\nPrices and the current list are always at https://visualsentinel.com/pricing. There is no free plan for new accounts: a new workspace gets a first check of its site, then a 7-day trial (card required) or a paid plan.\n\n| Plan | Monitors | Fastest uptime check | Visual pages | Status pages | API keys and MCP account tools |\n|---|---|---|---|---|---|\n| Solo | 10 | every 5 minutes | 1 site, every 30 minutes | 1 | no |\n| Starter | 15 | every 5 minutes | 5, every 15 minutes | 1 | no |\n| Business | 60 | every 1 minute | 60, every 15 minutes | 5 | yes |\n| Agency | 300 | every 1 minute | 300, every 15 minutes | 50 | yes |\n\n- The five public tools (vs_health, vs_dns_check, vs_ssl_check, vs_speed_test, vs_website_check) need no account.\n- The twelve account tools need an API key, which is available on the Business and Agency plans. Create one at https://visualsentinel.com/settings/api-keys.\n- Checks run from Europe and the US. Alert channels on every plan: email, Slack, Discord, Microsoft Teams, Telegram, PagerDuty, Opsgenie, webhooks, WhatsApp, Prometheus, and push notifications in the mobile app.\n`;\n\nconst HELP = `# Using the Visual Sentinel MCP server\n\nVisual Sentinel catches pages that look broken even when the site is up. It watches uptime, performance, SSL certificates, DNS, visual changes and content changes.\n\n## Start without an account\nAsk for a DNS lookup, an SSL certificate check, a speed test or a website check on any public site. These five tools need no account or key.\n\n## Connect your account\n1. Get an API key (Business and Agency plans): https://visualsentinel.com/settings/api-keys\n2. Set it as VS_API_KEY (or VISUALSENTINEL_API_KEY) in your MCP client's environment for this server.\n3. Restart the client. Monitor, uptime, incident, alert, status-page and server tools now work.\n\n## Ready-made prompts\ncheck_website_health, investigate_broken_site, pre_launch_checklist and triage_open_incidents.\n\n## Links\n- Docs and install: https://visualsentinel.com/mcp\n- API reference: https://visualsentinel.com/docs\n- Pricing: https://visualsentinel.com/pricing\n- Source: https://github.com/VisualSentinel/mcp-server\n- Support: https://visualsentinel.com/contact\n`;\n\nfunction toolsReference(): string {\n const rows = TOOLS.map(\n (t) => `| ${t.name} | ${t.requiresAuth ? 'API key (Business and Agency)' : 'none'} | ${t.annotations.readOnlyHint ? 'read-only' : 'changes data'} | ${(t.description.split('. ')[0] ?? '').replace(/\\.$/, '')} |`,\n );\n return [\n '# Visual Sentinel tools',\n '',\n '| Tool | Needs | Type | What it does |',\n '|---|---|---|---|',\n ...rows,\n '',\n ].join('\\n');\n}\n\nexport const RESOURCES: ResourceDefinition[] = [\n {\n uri: 'visualsentinel://plans',\n name: 'plans',\n title: 'Plans and limits',\n description: 'Monitor counts, check frequencies and which plans include API keys and the MCP account tools.',\n mimeType: 'text/markdown',\n read: () => PLANS,\n },\n {\n uri: 'visualsentinel://help',\n name: 'help',\n title: 'Help and setup',\n description: 'How to use the server without an account, how to add an API key, and where the docs are.',\n mimeType: 'text/markdown',\n read: () => HELP,\n },\n {\n uri: 'visualsentinel://tools',\n name: 'tools',\n title: 'Tool reference',\n description: 'Every tool, whether it needs an API key, and whether it is read-only.',\n mimeType: 'text/markdown',\n read: toolsReference,\n },\n];\n\nexport function findResource(uri: string): ResourceDefinition | undefined {\n return RESOURCES.find((r) => r.uri === uri);\n}\n"],"mappings":";;;AAqCA,IAAM,MAAM,EAAE,MAAM,SAAkB;AAEtC,IAAM,MAAM,EAAE,MAAM,UAAmB;AAGvC,SAAS,WAAW,MAA+B,KAAiC;AAClF,QAAM,IAAI,KAAK,GAAG;AAClB,SAAO,OAAO,MAAM,YAAY,EAAE,SAAS,IAAI,IAAI;AACrD;AAEA,SAAS,WAAW,MAA+B,KAAiC;AAClF,QAAM,IAAI,KAAK,GAAG;AAClB,SAAO,OAAO,MAAM,YAAY,OAAO,SAAS,CAAC,IAAI,IAAI;AAC3D;AAEA,SAAS,cAAc,MAA+B,KAAqB;AACzE,QAAM,IAAI,WAAW,MAAM,GAAG;AAC9B,MAAI,CAAC,EAAG,OAAM,IAAI,MAAM,aAAa,GAAG,yBAAyB;AACjE,SAAO;AACT;AAEO,IAAM,QAA0B;AAAA;AAAA;AAAA;AAAA,EAIrC;AAAA,IACE,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,MACX,OAAO;AAAA,MACP,cAAc;AAAA,MACd,iBAAiB;AAAA,MACjB,gBAAgB;AAAA,MAChB,eAAe;AAAA,IACjB;AAAA,IACA,aACE;AAAA,IACF,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY,CAAC;AAAA,MACb,sBAAsB;AAAA,IACxB;AAAA,IACA,cAAc;AAAA,IACd,SAAS,OAAO,OAAO,WAAW,OAAO,QAAQ,OAAO,eAAe,EAAE,MAAM,MAAM,CAAC;AAAA,EACxF;AAAA,EAEA;AAAA,IACE,MAAM;AAAA,IACN,OAAO;AAAA,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AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBtE,IAAM,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBb,SAAS,iBAAyB;AAChC,QAAM,OAAO,MAAM;AAAA,IACjB,CAAC,MAAM,KAAK,EAAE,IAAI,MAAM,EAAE,eAAe,kCAAkC,MAAM,MAAM,EAAE,YAAY,eAAe,cAAc,cAAc,OAAO,EAAE,YAAY,MAAM,IAAI,EAAE,CAAC,KAAK,IAAI,QAAQ,OAAO,EAAE,CAAC;AAAA,EAC/M;AACA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,IACH;AAAA,EACF,EAAE,KAAK,IAAI;AACb;AAEO,IAAM,YAAkC;AAAA,EAC7C;AAAA,IACE,KAAK;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,UAAU;AAAA,IACV,MAAM,MAAM;AAAA,EACd;AAAA,EACA;AAAA,IACE,KAAK;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,UAAU;AAAA,IACV,MAAM,MAAM;AAAA,EACd;AAAA,EACA;AAAA,IACE,KAAK;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,UAAU;AAAA,IACV,MAAM;AAAA,EACR;AACF;AAEO,SAAS,aAAa,KAA6C;AACxE,SAAO,UAAU,KAAK,CAAC,MAAM,EAAE,QAAQ,GAAG;AAC5C;","names":[]}
|
package/dist/tools.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ApiClient } from './api-client.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Tool registry for the Visual Sentinel MCP server.
|
|
5
|
+
*
|
|
6
|
+
* Each tool wraps a single Visual Sentinel REST endpoint with a JSON Schema
|
|
7
|
+
* input and a structured handler. Public-tool handlers (DNS check, SSL check,
|
|
8
|
+
* speed test, website check, health) run without authentication; everything
|
|
9
|
+
* else requires `VS_API_KEY`.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
interface ToolInput {
|
|
13
|
+
type: 'object';
|
|
14
|
+
properties: Record<string, unknown>;
|
|
15
|
+
required?: string[];
|
|
16
|
+
additionalProperties?: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface ToolAnnotations {
|
|
19
|
+
title: string;
|
|
20
|
+
readOnlyHint: boolean;
|
|
21
|
+
destructiveHint: boolean;
|
|
22
|
+
idempotentHint: boolean;
|
|
23
|
+
openWorldHint: boolean;
|
|
24
|
+
}
|
|
25
|
+
interface ToolDefinition {
|
|
26
|
+
name: string;
|
|
27
|
+
/** Human-readable title shown by MCP clients. */
|
|
28
|
+
title: string;
|
|
29
|
+
description: string;
|
|
30
|
+
annotations: ToolAnnotations;
|
|
31
|
+
inputSchema: ToolInput;
|
|
32
|
+
requiresAuth: boolean;
|
|
33
|
+
handler: (args: Record<string, unknown>, client: ApiClient) => Promise<unknown>;
|
|
34
|
+
}
|
|
35
|
+
declare const TOOLS: ToolDefinition[];
|
|
36
|
+
declare function findTool(name: string): ToolDefinition | undefined;
|
|
37
|
+
|
|
38
|
+
export { TOOLS, type ToolAnnotations, type ToolDefinition, findTool };
|
package/dist/tools.js
ADDED
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/tools.ts
|
|
4
|
+
var STR = { type: "string" };
|
|
5
|
+
var INT = { type: "integer" };
|
|
6
|
+
function pickString(args, key) {
|
|
7
|
+
const v = args[key];
|
|
8
|
+
return typeof v === "string" && v.length > 0 ? v : void 0;
|
|
9
|
+
}
|
|
10
|
+
function pickNumber(args, key) {
|
|
11
|
+
const v = args[key];
|
|
12
|
+
return typeof v === "number" && Number.isFinite(v) ? v : void 0;
|
|
13
|
+
}
|
|
14
|
+
function requireString(args, key) {
|
|
15
|
+
const v = pickString(args, key);
|
|
16
|
+
if (!v) throw new Error(`Argument "${key}" (string) is required.`);
|
|
17
|
+
return v;
|
|
18
|
+
}
|
|
19
|
+
var TOOLS = [
|
|
20
|
+
// -------------------------------------------------------------------------
|
|
21
|
+
// Public tools (no auth)
|
|
22
|
+
// -------------------------------------------------------------------------
|
|
23
|
+
{
|
|
24
|
+
name: "vs_health",
|
|
25
|
+
title: "Check Visual Sentinel service health",
|
|
26
|
+
annotations: {
|
|
27
|
+
title: "Check Visual Sentinel service health",
|
|
28
|
+
readOnlyHint: true,
|
|
29
|
+
destructiveHint: false,
|
|
30
|
+
idempotentHint: true,
|
|
31
|
+
openWorldHint: true
|
|
32
|
+
},
|
|
33
|
+
description: "Check whether Visual Sentinel itself is up. Returns the service health status. No authentication required.",
|
|
34
|
+
inputSchema: {
|
|
35
|
+
type: "object",
|
|
36
|
+
properties: {},
|
|
37
|
+
additionalProperties: false
|
|
38
|
+
},
|
|
39
|
+
requiresAuth: false,
|
|
40
|
+
handler: async (_args, client) => client.request("GET", "/api/health", { auth: false })
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "vs_dns_check",
|
|
44
|
+
title: "Look up DNS records",
|
|
45
|
+
annotations: {
|
|
46
|
+
title: "Look up DNS records",
|
|
47
|
+
readOnlyHint: true,
|
|
48
|
+
destructiveHint: false,
|
|
49
|
+
idempotentHint: true,
|
|
50
|
+
openWorldHint: true
|
|
51
|
+
},
|
|
52
|
+
description: "Resolve DNS records (A, AAAA, MX, NS, TXT, CNAME) for a domain using Visual Sentinel's public DNS lookup tool. No authentication required.",
|
|
53
|
+
inputSchema: {
|
|
54
|
+
type: "object",
|
|
55
|
+
properties: {
|
|
56
|
+
domain: { ...STR, description: "Domain to resolve, e.g. example.com (without protocol)." },
|
|
57
|
+
recordType: {
|
|
58
|
+
...STR,
|
|
59
|
+
description: "Optional: limit to one record type. One of: A, AAAA, MX, NS, TXT, CNAME, SOA. Default: all."
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
required: ["domain"],
|
|
63
|
+
additionalProperties: false
|
|
64
|
+
},
|
|
65
|
+
requiresAuth: false,
|
|
66
|
+
handler: async (args, client) => client.request("GET", "/api/tools/dns-check", {
|
|
67
|
+
auth: false,
|
|
68
|
+
query: {
|
|
69
|
+
domain: requireString(args, "domain"),
|
|
70
|
+
// The API reads ?type= (not recordType).
|
|
71
|
+
type: pickString(args, "recordType")
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: "vs_ssl_check",
|
|
77
|
+
title: "Inspect an SSL certificate",
|
|
78
|
+
annotations: {
|
|
79
|
+
title: "Inspect an SSL certificate",
|
|
80
|
+
readOnlyHint: true,
|
|
81
|
+
destructiveHint: false,
|
|
82
|
+
idempotentHint: true,
|
|
83
|
+
openWorldHint: true
|
|
84
|
+
},
|
|
85
|
+
description: "Inspect a TLS/SSL certificate for a hostname: issuer, subject, validity dates, SAN list, key algorithm, and certificate chain. No authentication required.",
|
|
86
|
+
inputSchema: {
|
|
87
|
+
type: "object",
|
|
88
|
+
properties: {
|
|
89
|
+
domain: { ...STR, description: "Hostname to inspect, e.g. example.com (without protocol)." }
|
|
90
|
+
},
|
|
91
|
+
required: ["domain"],
|
|
92
|
+
additionalProperties: false
|
|
93
|
+
},
|
|
94
|
+
requiresAuth: false,
|
|
95
|
+
handler: async (args, client) => client.request("GET", "/api/tools/ssl-check", {
|
|
96
|
+
auth: false,
|
|
97
|
+
// The API reads ?domain=. `host` stays as an input alias for 0.1.x callers.
|
|
98
|
+
query: { domain: pickString(args, "domain") ?? requireString(args, "host") }
|
|
99
|
+
})
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "vs_speed_test",
|
|
103
|
+
title: "Run a one-shot speed test",
|
|
104
|
+
annotations: {
|
|
105
|
+
title: "Run a one-shot speed test",
|
|
106
|
+
readOnlyHint: true,
|
|
107
|
+
destructiveHint: false,
|
|
108
|
+
idempotentHint: true,
|
|
109
|
+
openWorldHint: true
|
|
110
|
+
},
|
|
111
|
+
description: "Run a one-shot Lighthouse lab test on a URL. Returns the performance score (0 to 100) plus Largest Contentful Paint, First Contentful Paint, Cumulative Layout Shift, Time to First Byte, Total Blocking Time and Speed Index (times in milliseconds). No account needed.",
|
|
112
|
+
inputSchema: {
|
|
113
|
+
type: "object",
|
|
114
|
+
properties: {
|
|
115
|
+
url: { ...STR, description: "Full URL to test, including protocol (https://...)." }
|
|
116
|
+
},
|
|
117
|
+
required: ["url"],
|
|
118
|
+
additionalProperties: false
|
|
119
|
+
},
|
|
120
|
+
requiresAuth: false,
|
|
121
|
+
handler: async (args, client) => client.request("GET", "/api/tools/speed-test", {
|
|
122
|
+
auth: false,
|
|
123
|
+
query: { url: requireString(args, "url") }
|
|
124
|
+
})
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: "vs_website_check",
|
|
128
|
+
title: "Check a website",
|
|
129
|
+
annotations: {
|
|
130
|
+
title: "Check a website",
|
|
131
|
+
readOnlyHint: true,
|
|
132
|
+
destructiveHint: false,
|
|
133
|
+
idempotentHint: true,
|
|
134
|
+
openWorldHint: true
|
|
135
|
+
},
|
|
136
|
+
description: "Quick health check for a URL: HTTP status, response time, server header, content snippet, and basic SSL state. No authentication required.",
|
|
137
|
+
inputSchema: {
|
|
138
|
+
type: "object",
|
|
139
|
+
properties: {
|
|
140
|
+
url: { ...STR, description: "Full URL to test, including protocol (https://...)." }
|
|
141
|
+
},
|
|
142
|
+
required: ["url"],
|
|
143
|
+
additionalProperties: false
|
|
144
|
+
},
|
|
145
|
+
requiresAuth: false,
|
|
146
|
+
handler: async (args, client) => client.request("GET", "/api/tools/website-check", {
|
|
147
|
+
auth: false,
|
|
148
|
+
query: { url: requireString(args, "url") }
|
|
149
|
+
})
|
|
150
|
+
},
|
|
151
|
+
// -------------------------------------------------------------------------
|
|
152
|
+
// Authenticated tools (require VS_API_KEY)
|
|
153
|
+
// -------------------------------------------------------------------------
|
|
154
|
+
{
|
|
155
|
+
name: "vs_monitors_list",
|
|
156
|
+
title: "List monitors",
|
|
157
|
+
annotations: {
|
|
158
|
+
title: "List monitors",
|
|
159
|
+
readOnlyHint: true,
|
|
160
|
+
destructiveHint: false,
|
|
161
|
+
idempotentHint: true,
|
|
162
|
+
openWorldHint: false
|
|
163
|
+
},
|
|
164
|
+
description: "List monitors in the authenticated organization. Optional filters narrow by status, type, or paginate.",
|
|
165
|
+
inputSchema: {
|
|
166
|
+
type: "object",
|
|
167
|
+
properties: {
|
|
168
|
+
status: { ...STR, description: "Filter: UP, DOWN, PAUSED, MAINTENANCE." },
|
|
169
|
+
type: {
|
|
170
|
+
...STR,
|
|
171
|
+
description: "Filter by monitor type: HTTP, HTTPS, KEYWORD, PING, PORT, DNS, SSL, VISUAL, CONTENT, API, GRAPHQL, WEBSOCKET."
|
|
172
|
+
},
|
|
173
|
+
page: { ...INT, description: "Page number (default 1)." },
|
|
174
|
+
limit: { ...INT, description: "Items per page (default 50, max 200)." }
|
|
175
|
+
},
|
|
176
|
+
additionalProperties: false
|
|
177
|
+
},
|
|
178
|
+
requiresAuth: true,
|
|
179
|
+
handler: async (args, client) => client.request("GET", "/api/monitors", {
|
|
180
|
+
query: {
|
|
181
|
+
status: pickString(args, "status"),
|
|
182
|
+
type: pickString(args, "type"),
|
|
183
|
+
page: pickNumber(args, "page"),
|
|
184
|
+
limit: pickNumber(args, "limit")
|
|
185
|
+
}
|
|
186
|
+
})
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: "vs_monitors_get",
|
|
190
|
+
title: "Get a monitor",
|
|
191
|
+
annotations: {
|
|
192
|
+
title: "Get a monitor",
|
|
193
|
+
readOnlyHint: true,
|
|
194
|
+
destructiveHint: false,
|
|
195
|
+
idempotentHint: true,
|
|
196
|
+
openWorldHint: false
|
|
197
|
+
},
|
|
198
|
+
description: "Fetch a single monitor by id, including its current status, last check, and configuration.",
|
|
199
|
+
inputSchema: {
|
|
200
|
+
type: "object",
|
|
201
|
+
properties: {
|
|
202
|
+
id: { ...STR, description: "Monitor id (cuid)." }
|
|
203
|
+
},
|
|
204
|
+
required: ["id"],
|
|
205
|
+
additionalProperties: false
|
|
206
|
+
},
|
|
207
|
+
requiresAuth: true,
|
|
208
|
+
handler: async (args, client) => client.request("GET", `/api/monitors/${encodeURIComponent(requireString(args, "id"))}`)
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: "vs_monitors_create",
|
|
212
|
+
title: "Create a monitor",
|
|
213
|
+
annotations: {
|
|
214
|
+
title: "Create a monitor",
|
|
215
|
+
readOnlyHint: false,
|
|
216
|
+
destructiveHint: false,
|
|
217
|
+
idempotentHint: false,
|
|
218
|
+
openWorldHint: false
|
|
219
|
+
},
|
|
220
|
+
description: "Create a new monitor. Provide at least name, url, and type. Returns the created monitor including its assigned id.",
|
|
221
|
+
inputSchema: {
|
|
222
|
+
type: "object",
|
|
223
|
+
properties: {
|
|
224
|
+
name: { ...STR, description: "Display name for the monitor." },
|
|
225
|
+
url: { ...STR, description: "Full URL to monitor (or hostname for PING/PORT/DNS/SSL)." },
|
|
226
|
+
type: {
|
|
227
|
+
...STR,
|
|
228
|
+
description: "Monitor type: HTTP, HTTPS, KEYWORD, PING, PORT, DNS, SSL, VISUAL, CONTENT, API, GRAPHQL, WEBSOCKET."
|
|
229
|
+
},
|
|
230
|
+
interval: { ...INT, description: "Check interval in seconds (60, 300, 600, 1800, 3600)." },
|
|
231
|
+
timeout: { ...INT, description: "Per-check timeout in seconds (default 30)." },
|
|
232
|
+
method: { ...STR, description: "HTTP method for HTTP/HTTPS monitors (default GET)." },
|
|
233
|
+
keyword: { ...STR, description: "Keyword to assert for KEYWORD monitors." },
|
|
234
|
+
port: { ...INT, description: "TCP port for PORT monitors." }
|
|
235
|
+
},
|
|
236
|
+
required: ["name", "url", "type"],
|
|
237
|
+
additionalProperties: false
|
|
238
|
+
},
|
|
239
|
+
requiresAuth: true,
|
|
240
|
+
handler: async (args, client) => client.request("POST", "/api/monitors", {
|
|
241
|
+
body: {
|
|
242
|
+
name: requireString(args, "name"),
|
|
243
|
+
url: requireString(args, "url"),
|
|
244
|
+
type: requireString(args, "type"),
|
|
245
|
+
interval: pickNumber(args, "interval"),
|
|
246
|
+
timeout: pickNumber(args, "timeout"),
|
|
247
|
+
method: pickString(args, "method"),
|
|
248
|
+
keyword: pickString(args, "keyword"),
|
|
249
|
+
port: pickNumber(args, "port")
|
|
250
|
+
}
|
|
251
|
+
})
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
name: "vs_monitors_check_now",
|
|
255
|
+
title: "Run a monitor check now",
|
|
256
|
+
annotations: {
|
|
257
|
+
title: "Run a monitor check now",
|
|
258
|
+
readOnlyHint: false,
|
|
259
|
+
destructiveHint: false,
|
|
260
|
+
idempotentHint: false,
|
|
261
|
+
openWorldHint: false
|
|
262
|
+
},
|
|
263
|
+
description: "Trigger an immediate check for a monitor (in addition to its scheduled cadence). Returns the freshly-collected check result.",
|
|
264
|
+
inputSchema: {
|
|
265
|
+
type: "object",
|
|
266
|
+
properties: {
|
|
267
|
+
id: { ...STR, description: "Monitor id." }
|
|
268
|
+
},
|
|
269
|
+
required: ["id"],
|
|
270
|
+
additionalProperties: false
|
|
271
|
+
},
|
|
272
|
+
requiresAuth: true,
|
|
273
|
+
handler: async (args, client) => client.request("POST", `/api/monitors/${encodeURIComponent(requireString(args, "id"))}/check`)
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
name: "vs_monitors_uptime",
|
|
277
|
+
title: "Get monitor uptime",
|
|
278
|
+
annotations: {
|
|
279
|
+
title: "Get monitor uptime",
|
|
280
|
+
readOnlyHint: true,
|
|
281
|
+
destructiveHint: false,
|
|
282
|
+
idempotentHint: true,
|
|
283
|
+
openWorldHint: false
|
|
284
|
+
},
|
|
285
|
+
description: "Fetch the uptime percentage and time-series breakdown for a monitor. Use `window` for a preset window (24h, 7d, 30d, 90d, 365d; default 30d), supply both `from` and `to` (ISO 8601) for a custom date range, or set `all: true` for the full available history.",
|
|
286
|
+
inputSchema: {
|
|
287
|
+
type: "object",
|
|
288
|
+
properties: {
|
|
289
|
+
id: { ...STR, description: "Monitor id." },
|
|
290
|
+
window: {
|
|
291
|
+
...STR,
|
|
292
|
+
description: "Preset window: 1h, 6h, 24h, 7d, 30d, 90d, 365d. Default 30d. Ignored when from+to or all are supplied."
|
|
293
|
+
},
|
|
294
|
+
from: {
|
|
295
|
+
...STR,
|
|
296
|
+
description: "ISO 8601 start of a custom range (e.g. 2026-01-01T00:00:00Z). Must be supplied with `to`."
|
|
297
|
+
},
|
|
298
|
+
to: {
|
|
299
|
+
...STR,
|
|
300
|
+
description: "ISO 8601 end of a custom range. Must be supplied with `from`."
|
|
301
|
+
},
|
|
302
|
+
all: {
|
|
303
|
+
type: "boolean",
|
|
304
|
+
description: "Return the full available history from the earliest stored data. Takes precedence over from/to and window."
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
required: ["id"],
|
|
308
|
+
additionalProperties: false
|
|
309
|
+
},
|
|
310
|
+
requiresAuth: true,
|
|
311
|
+
handler: async (args, client) => {
|
|
312
|
+
const from = pickString(args, "from");
|
|
313
|
+
const to = pickString(args, "to");
|
|
314
|
+
const query = args["all"] === true ? { all: true } : from && to ? { from, to } : { period: pickString(args, "window") ?? "30d" };
|
|
315
|
+
return client.request(
|
|
316
|
+
"GET",
|
|
317
|
+
`/api/monitors/${encodeURIComponent(requireString(args, "id"))}/uptime`,
|
|
318
|
+
{ query }
|
|
319
|
+
);
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
name: "vs_monitors_metrics_bulk",
|
|
324
|
+
title: "Get bulk monitor metrics",
|
|
325
|
+
annotations: {
|
|
326
|
+
title: "Get bulk monitor metrics",
|
|
327
|
+
readOnlyHint: true,
|
|
328
|
+
destructiveHint: false,
|
|
329
|
+
idempotentHint: true,
|
|
330
|
+
openWorldHint: false
|
|
331
|
+
},
|
|
332
|
+
description: "Fetch uptime or response-time metrics for up to 100 monitors in a single request. Use `window` for a preset window (1h, 6h, 24h, 7d, 30d, 90d, 365d; default 30d), supply both `from` and `to` (ISO 8601) for a custom date range, or set `all: true` for the full available history. Returns a `monitors` object keyed by monitor id.",
|
|
333
|
+
inputSchema: {
|
|
334
|
+
type: "object",
|
|
335
|
+
properties: {
|
|
336
|
+
monitorIds: {
|
|
337
|
+
type: "array",
|
|
338
|
+
items: { type: "string" },
|
|
339
|
+
description: "List of monitor IDs to fetch metrics for (max 100)."
|
|
340
|
+
},
|
|
341
|
+
metric: {
|
|
342
|
+
...STR,
|
|
343
|
+
description: 'Metric to return: "uptime" or "response-time".'
|
|
344
|
+
},
|
|
345
|
+
window: {
|
|
346
|
+
...STR,
|
|
347
|
+
description: "Preset window: 1h, 6h, 24h, 7d, 30d, 90d, 365d. Default 30d. Ignored when from+to or all are supplied."
|
|
348
|
+
},
|
|
349
|
+
from: {
|
|
350
|
+
...STR,
|
|
351
|
+
description: "ISO 8601 start of a custom range (e.g. 2026-01-01T00:00:00Z). Must be supplied with `to`."
|
|
352
|
+
},
|
|
353
|
+
to: {
|
|
354
|
+
...STR,
|
|
355
|
+
description: "ISO 8601 end of a custom range. Must be supplied with `from`."
|
|
356
|
+
},
|
|
357
|
+
all: {
|
|
358
|
+
type: "boolean",
|
|
359
|
+
description: "Return the full available history from the earliest stored data. Takes precedence over from/to and window."
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
required: ["monitorIds", "metric"],
|
|
363
|
+
additionalProperties: false
|
|
364
|
+
},
|
|
365
|
+
requiresAuth: true,
|
|
366
|
+
handler: async (args, client) => {
|
|
367
|
+
const monitorIds = args["monitorIds"];
|
|
368
|
+
if (!Array.isArray(monitorIds) || monitorIds.length === 0) {
|
|
369
|
+
throw new Error('Argument "monitorIds" must be a non-empty array.');
|
|
370
|
+
}
|
|
371
|
+
const from = pickString(args, "from");
|
|
372
|
+
const to = pickString(args, "to");
|
|
373
|
+
const body = {
|
|
374
|
+
monitorIds,
|
|
375
|
+
metric: requireString(args, "metric")
|
|
376
|
+
};
|
|
377
|
+
if (args["all"] === true) {
|
|
378
|
+
body["all"] = true;
|
|
379
|
+
} else if (from && to) {
|
|
380
|
+
body["from"] = from;
|
|
381
|
+
body["to"] = to;
|
|
382
|
+
} else {
|
|
383
|
+
body["period"] = pickString(args, "window") ?? "30d";
|
|
384
|
+
}
|
|
385
|
+
return client.request("POST", "/api/monitors/metrics", { body });
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
name: "vs_incidents_list",
|
|
390
|
+
title: "List incidents",
|
|
391
|
+
annotations: {
|
|
392
|
+
title: "List incidents",
|
|
393
|
+
readOnlyHint: true,
|
|
394
|
+
destructiveHint: false,
|
|
395
|
+
idempotentHint: true,
|
|
396
|
+
openWorldHint: false
|
|
397
|
+
},
|
|
398
|
+
description: "List incidents for the authenticated organization. Filter by status (OPEN/RESOLVED), monitor id, or paginate.",
|
|
399
|
+
inputSchema: {
|
|
400
|
+
type: "object",
|
|
401
|
+
properties: {
|
|
402
|
+
status: { ...STR, description: "OPEN or RESOLVED." },
|
|
403
|
+
monitorId: { ...STR, description: "Filter to one monitor." },
|
|
404
|
+
page: { ...INT },
|
|
405
|
+
limit: { ...INT, description: "Default 50, max 200." }
|
|
406
|
+
},
|
|
407
|
+
additionalProperties: false
|
|
408
|
+
},
|
|
409
|
+
requiresAuth: true,
|
|
410
|
+
handler: async (args, client) => client.request("GET", "/api/incidents", {
|
|
411
|
+
query: {
|
|
412
|
+
status: pickString(args, "status"),
|
|
413
|
+
monitorId: pickString(args, "monitorId"),
|
|
414
|
+
page: pickNumber(args, "page"),
|
|
415
|
+
limit: pickNumber(args, "limit")
|
|
416
|
+
}
|
|
417
|
+
})
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
name: "vs_incidents_get",
|
|
421
|
+
title: "Get an incident",
|
|
422
|
+
annotations: {
|
|
423
|
+
title: "Get an incident",
|
|
424
|
+
readOnlyHint: true,
|
|
425
|
+
destructiveHint: false,
|
|
426
|
+
idempotentHint: true,
|
|
427
|
+
openWorldHint: false
|
|
428
|
+
},
|
|
429
|
+
description: "Fetch a single incident with its full check history and root-cause hints.",
|
|
430
|
+
inputSchema: {
|
|
431
|
+
type: "object",
|
|
432
|
+
properties: {
|
|
433
|
+
id: { ...STR, description: "Incident id." }
|
|
434
|
+
},
|
|
435
|
+
required: ["id"],
|
|
436
|
+
additionalProperties: false
|
|
437
|
+
},
|
|
438
|
+
requiresAuth: true,
|
|
439
|
+
handler: async (args, client) => client.request("GET", `/api/incidents/${encodeURIComponent(requireString(args, "id"))}`)
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
name: "vs_alerts_list",
|
|
443
|
+
title: "List alerts",
|
|
444
|
+
annotations: {
|
|
445
|
+
title: "List alerts",
|
|
446
|
+
readOnlyHint: true,
|
|
447
|
+
destructiveHint: false,
|
|
448
|
+
idempotentHint: true,
|
|
449
|
+
openWorldHint: false
|
|
450
|
+
},
|
|
451
|
+
description: "List alerts for the authenticated organization. Filter by status (UNACKNOWLEDGED/ACKNOWLEDGED/RESOLVED) or paginate.",
|
|
452
|
+
inputSchema: {
|
|
453
|
+
type: "object",
|
|
454
|
+
properties: {
|
|
455
|
+
status: { ...STR, description: "UNACKNOWLEDGED, ACKNOWLEDGED, or RESOLVED." },
|
|
456
|
+
page: { ...INT },
|
|
457
|
+
limit: { ...INT, description: "Default 50, max 200." }
|
|
458
|
+
},
|
|
459
|
+
additionalProperties: false
|
|
460
|
+
},
|
|
461
|
+
requiresAuth: true,
|
|
462
|
+
handler: async (args, client) => client.request("GET", "/api/alerts", {
|
|
463
|
+
query: {
|
|
464
|
+
status: pickString(args, "status"),
|
|
465
|
+
page: pickNumber(args, "page"),
|
|
466
|
+
limit: pickNumber(args, "limit")
|
|
467
|
+
}
|
|
468
|
+
})
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
name: "vs_alerts_acknowledge",
|
|
472
|
+
title: "Acknowledge an alert",
|
|
473
|
+
annotations: {
|
|
474
|
+
title: "Acknowledge an alert",
|
|
475
|
+
readOnlyHint: false,
|
|
476
|
+
destructiveHint: false,
|
|
477
|
+
idempotentHint: true,
|
|
478
|
+
openWorldHint: false
|
|
479
|
+
},
|
|
480
|
+
description: "Acknowledge an alert by id. The acknowledgement is recorded against the account that authorised this connection.",
|
|
481
|
+
inputSchema: {
|
|
482
|
+
type: "object",
|
|
483
|
+
properties: {
|
|
484
|
+
id: { ...STR, description: "Alert id." },
|
|
485
|
+
note: { ...STR, description: "Optional acknowledgement note (visible in alert history)." }
|
|
486
|
+
},
|
|
487
|
+
required: ["id"],
|
|
488
|
+
additionalProperties: false
|
|
489
|
+
},
|
|
490
|
+
requiresAuth: true,
|
|
491
|
+
handler: async (args, client) => client.request("POST", `/api/alerts/${encodeURIComponent(requireString(args, "id"))}/acknowledge`, {
|
|
492
|
+
body: { note: pickString(args, "note") }
|
|
493
|
+
})
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
name: "vs_status_pages_list",
|
|
497
|
+
title: "List status pages",
|
|
498
|
+
annotations: {
|
|
499
|
+
title: "List status pages",
|
|
500
|
+
readOnlyHint: true,
|
|
501
|
+
destructiveHint: false,
|
|
502
|
+
idempotentHint: true,
|
|
503
|
+
openWorldHint: false
|
|
504
|
+
},
|
|
505
|
+
description: "List public-facing status pages owned by the authenticated organization.",
|
|
506
|
+
inputSchema: {
|
|
507
|
+
type: "object",
|
|
508
|
+
properties: {},
|
|
509
|
+
additionalProperties: false
|
|
510
|
+
},
|
|
511
|
+
requiresAuth: true,
|
|
512
|
+
handler: async (_args, client) => client.request("GET", "/api/status-pages")
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
name: "vs_servers_list",
|
|
516
|
+
title: "List servers",
|
|
517
|
+
annotations: {
|
|
518
|
+
title: "List servers",
|
|
519
|
+
readOnlyHint: true,
|
|
520
|
+
destructiveHint: false,
|
|
521
|
+
idempotentHint: true,
|
|
522
|
+
openWorldHint: false
|
|
523
|
+
},
|
|
524
|
+
description: "List servers (origins) registered in the authenticated organization.",
|
|
525
|
+
inputSchema: {
|
|
526
|
+
type: "object",
|
|
527
|
+
properties: {
|
|
528
|
+
page: { ...INT },
|
|
529
|
+
limit: { ...INT, description: "Default 50." }
|
|
530
|
+
},
|
|
531
|
+
additionalProperties: false
|
|
532
|
+
},
|
|
533
|
+
requiresAuth: true,
|
|
534
|
+
handler: async (args, client) => client.request("GET", "/api/servers", {
|
|
535
|
+
query: { page: pickNumber(args, "page"), limit: pickNumber(args, "limit") }
|
|
536
|
+
})
|
|
537
|
+
}
|
|
538
|
+
];
|
|
539
|
+
function findTool(name) {
|
|
540
|
+
return TOOLS.find((t) => t.name === name);
|
|
541
|
+
}
|
|
542
|
+
export {
|
|
543
|
+
TOOLS,
|
|
544
|
+
findTool
|
|
545
|
+
};
|
|
546
|
+
//# sourceMappingURL=tools.js.map
|