vs_health
Check the operational status of the Visual Sentinel service. Returns health data without authentication.
Instructions
Check whether Visual Sentinel itself is up. Returns the service health status. No authentication required.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools.ts:48-63 (handler)The actual handler for the vs_health tool: makes a GET request to '/api/health' without authentication. The _args parameter is ignored (no inputs required), and it delegates to the ApiClient.request method.
export const TOOLS: ToolDefinition[] = [ // ------------------------------------------------------------------------- // Public tools (no auth) // ------------------------------------------------------------------------- { name: 'vs_health', description: 'Check whether Visual Sentinel itself is up. Returns the service health status. No authentication required.', inputSchema: { type: 'object', properties: {}, additionalProperties: false, }, requiresAuth: false, handler: async (_args, client) => client.request('GET', '/api/health', { auth: false }), }, - src/tools.ts:56-59 (schema)The input schema for vs_health: an empty object with no properties, meaning the tool accepts no arguments.
inputSchema: { type: 'object', properties: {}, additionalProperties: false, - src/tools.ts:52-63 (registration)The vs_health tool is registered in the TOOLS array at index 0. It's a public tool with requiresAuth: false. The entry includes name, description, inputSchema, requiresAuth, and handler.
{ name: 'vs_health', description: 'Check whether Visual Sentinel itself is up. Returns the service health status. No authentication required.', inputSchema: { type: 'object', properties: {}, additionalProperties: false, }, requiresAuth: false, handler: async (_args, client) => client.request('GET', '/api/health', { auth: false }), }, - src/api-client.ts:51-104 (helper)The ApiClient.request method that the vs_health handler calls. Because auth: false is passed, the method skips the API key check. It constructs the URL, sends an HTTP GET request, parses the JSON response, and returns the result.
async request<T = unknown>( method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE', path: string, options: { query?: Record<string, string | number | boolean | undefined>; body?: unknown; auth?: boolean } = {}, ): Promise<T> { const auth = options.auth ?? true; if (auth && !this.hasApiKey()) { throw new VsApiError( 'Visual Sentinel API key required. Set VS_API_KEY (https://visualsentinel.com/settings/api-keys).', 401, null, ); } const url = new URL(path.startsWith('/') ? path : `/${path}`, this.baseUrl); if (options.query) { for (const [k, v] of Object.entries(options.query)) { if (v !== undefined && v !== null) url.searchParams.set(k, String(v)); } } const headers: Record<string, string> = { Accept: 'application/json', 'User-Agent': this.userAgent, }; if (auth && this.apiKey) headers['X-API-Key'] = this.apiKey; if (options.body !== undefined) headers['Content-Type'] = 'application/json'; const res = await fetch(url, { method, headers, body: options.body !== undefined ? JSON.stringify(options.body) : undefined, }); const text = await res.text(); let parsed: unknown = null; if (text.length > 0) { try { parsed = JSON.parse(text); } catch { parsed = text; } } if (!res.ok) { throw new VsApiError( `Visual Sentinel API ${method} ${path} returned ${res.status}`, res.status, parsed, ); } return parsed as T; }