get_collaboration_health
Assess the operational status and performance of the Tiptap collaborative document service by retrieving its current health metrics for effective monitoring and troubleshooting.
Instructions
Get the health status of the Tiptap collaboration service
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}
Implementation Reference
- The tool handler that performs a health check on the Tiptap collaboration service by fetching the /health endpoint with appropriate headers and authorization token, returning a structured text response with the result or error message.async () => { try { const headers: Record<string, string> = { 'User-Agent': 'tiptap-collaboration-mcp', 'Content-Type': 'application/json', }; const token = getToken(); if (token) headers.Authorization = token; const response = await fetch(`${getBaseUrl()}/health`, { headers }); if (!response.ok) { return { content: [ { type: 'text', text: `Health check HTTP error: ${response.status} ${response.statusText}`, }, ], }; } return { content: [ { type: 'text', text: `Health check response: ${await response.text()}`, }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error connecting to Tiptap collaboration service: ${ error instanceof Error ? error.message : 'Unknown error' }`, }, ], }; } }
- src/tools/get-collaboration-health.ts:3-55 (registration)The exported registration function that defines and registers the 'get_collaboration_health' tool on the MCP server, including name, description, empty input schema, and the handler.export default function registerGetCollaborationHealth( server: McpServer, getBaseUrl: () => string, getToken: () => string | undefined ) { server.tool( 'get-collaboration-health', 'Check Tiptap collaboration service health status', {}, async () => { try { const headers: Record<string, string> = { 'User-Agent': 'tiptap-collaboration-mcp', 'Content-Type': 'application/json', }; const token = getToken(); if (token) headers.Authorization = token; const response = await fetch(`${getBaseUrl()}/health`, { headers }); if (!response.ok) { return { content: [ { type: 'text', text: `Health check HTTP error: ${response.status} ${response.statusText}`, }, ], }; } return { content: [ { type: 'text', text: `Health check response: ${await response.text()}`, }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error connecting to Tiptap collaboration service: ${ error instanceof Error ? error.message : 'Unknown error' }`, }, ], }; } } ); }
- src/server.ts:52-52 (registration)Invocation of the tool registration function during MCP server initialization.registerGetCollaborationHealth(server, getBaseUrl, getToken);
- src/server.ts:8-8 (registration)Import of the registration function for the get_collaboration_health tool.import registerGetCollaborationHealth from './tools/get-collaboration-health.js';