health
Verify your TestDino connection by checking PAT, account details, and listing organizations and projects. Use to confirm setup and retrieve IDs for other tools.
Instructions
Check if your TestDino connection is working. Verifies your PAT, shows your account information, and lists available organizations and projects. Use this first to make sure everything is set up correctly and to get organization/project IDs for other tools.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/health.ts:20-205 (handler)handleHealth - Executes the health check logic: validates PAT, calls /api/mcp/hello endpoint, and returns formatted account/org/project info.
export async function handleHealth(args?: Record<string, unknown>) { // Validate PAT and get user info using /api/mcp/hello endpoint try { // Read PAT from environment variable (set in mcp.json) or from args const token = getApiKey(args); if (!token) { return { content: [ { type: "text", text: "β **Error**: Missing TESTDINO_PAT environment variable.\n\nPlease configure it in your .cursor/mcp.json file under the 'env' section.", }, ], }; } const helloEndpoint = endpoints.hello(); const response = await apiRequestJson<{ success?: boolean; message?: string; data?: { user: { id: string; email: string; firstName?: string; lastName?: string; fullName: string; }; pat: { id: string; name: string; }; access: Array<{ organizationId: string; organizationName: string; projects: Array<{ projectId: string; projectName: string; modules: { testRuns: boolean; manualTestCases: boolean; }; permissions: { canRead: boolean; canWrite: boolean; role: string; }; }>; }>; }; }>(helloEndpoint, { headers: { Authorization: `Bearer ${token}`, }, }); // Handle wrapped response structure (success helper format) const responseData = response.data || response; // Type guard to check if we have the expected data structure if ( !responseData || typeof responseData === "string" || !("user" in responseData) ) { return { content: [ { type: "text", text: `β **Error**: Unexpected response from TestDino server.\n\n${JSON.stringify(responseData)}`, }, ], }; } const data = responseData as { user: { id: string; email: string; firstName?: string; lastName?: string; fullName: string; }; pat: { id: string; name: string; }; access: Array<{ organizationId: string; organizationName: string; projects: Array<{ projectId: string; projectName: string; modules: { testRuns: boolean; manualTestCases: boolean; }; permissions: { canRead: boolean; canWrite: boolean; role: string; }; }>; }>; }; // Format the response let output = `β **TestDino Connection Successful!**\n\n`; output += `π€ **Account**: ${data.user.fullName}\n`; output += `π **PAT**: ${data.pat.name}\n\n`; if (!data.access || data.access.length === 0) { output += `β οΈ **No Organizations Found**\n\nYour PAT doesn't have access to any organizations or projects.\nPlease contact your administrator to grant access.`; } else { // Calculate totals const totalOrgs = data.access.length; const totalProjects = data.access.reduce( (sum, org) => sum + (org.projects?.length || 0), 0 ); output += `π **Access Summary**\n`; output += `ββββββββββββββββββββββββββββββββββββββββ\n`; output += `Organizations: ${totalOrgs} | Projects: ${totalProjects}\n`; output += `ββββββββββββββββββββββββββββββββββββββββ\n\n`; data.access.forEach((org, orgIndex) => { output += `**${orgIndex + 1}. ${org.organizationName}**\n`; output += ` π Org ID: \`${org.organizationId}\`\n`; if (org.projects && org.projects.length > 0) { output += ` π Projects (${org.projects.length}):\n\n`; org.projects.forEach((project, projIndex) => { const accessIcon = project.permissions.canWrite ? "βοΈ" : "ποΈ"; const accessLabel = project.permissions.canWrite ? "Write" : "Read"; output += ` ${orgIndex + 1}.${projIndex + 1} ${accessIcon} **${project.projectName}**\n`; output += ` β’ Project ID: \`${project.projectId}\`\n`; output += ` β’ Access: ${accessLabel} (${project.permissions.role})\n`; if (project.modules.testRuns) { output += ` β’ Modules: Test Runs β\n`; } if (project.modules.manualTestCases) { output += ` β’ Modules: Test Case Management β\n`; } output += `\n`; }); } else { output += ` βΉοΈ No projects available\n\n`; } // Add separator between organizations (except after the last one) if (orgIndex < data.access.length - 1) { output += ` βββββββββββββββββββββββββββββββββββββ\n\n`; } }); output += `\nββββββββββββββββββββββββββββββββββββββββ\n`; output += `\nHelloπ ${data.user.firstName}!\n`; output += `You can use organisation Id and project Id in other MCP tools.\n`; output += `Happy Testing!π`; } return { content: [ { type: "text", text: output, }, ], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [ { type: "text", text: `β **Error validating PAT**\n\n${errorMessage}\n\nPlease check your PAT and try again.`, }, ], }; } } - src/tools/health.ts:9-18 (schema)healthTool definition with name 'health', description, and empty inputSchema (no required params).
export const healthTool = { name: "health", description: "Check if your TestDino connection is working. Verifies your PAT, shows your account information, and lists available organizations and projects. Use this first to make sure everything is set up correctly and to get organization/project IDs for other tools.", inputSchema: { type: "object", properties: {}, required: [], }, }; - src/index.ts:197-199 (registration)Tool call routing: routes 'health' to handleHealth(args) in the CallToolRequestSchema handler.
if (name === "health") { return await handleHealth(args); } - src/index.ts:100-100 (registration)Tool listing: healthTool included in the tools array for ListToolsRequestSchema.
healthTool, - src/lib/endpoints.ts:178-181 (helper)hello() endpoint helper - returns the URL for the health check endpoint /api/mcp/hello.
hello: (): string => { const baseUrl = getBaseUrl(); return `${baseUrl}/api/mcp/hello`; },