ping
Verify configured credentials and return account identity details to confirm authentication before creating or exporting presentations.
Instructions
Verify the configured Alai credentials and return account identity details. Use this first when you need to confirm authentication before creating or exporting presentations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.js:99-113 (registration)Registration of the 'ping' tool via server.registerTool with name 'ping', description, empty inputSchema, and an async handler.
server.registerTool( "ping", { description: "Verify the configured Alai credentials and return account identity details. Use this first when you need to confirm authentication before creating or exporting presentations.", inputSchema: {}, }, async () => { try { return await callRemoteTool("ping", {}); } catch (error) { return normalizeError(error); } }, ); - src/index.js:106-112 (handler)Handler function for the 'ping' tool. Calls callRemoteTool('ping', {}) and returns the result, catching errors via normalizeError.
async () => { try { return await callRemoteTool("ping", {}); } catch (error) { return normalizeError(error); } }, - src/index.js:100-101 (schema)Input schema for the 'ping' tool is an empty object (inputSchema: {}), meaning it takes no arguments.
"ping", { - src/index.js:22-43 (helper)The callRemoteTool helper function that creates an MCP client, connects via StreamableHTTPClientTransport, and calls client.callTool with the tool name and arguments.
async function callRemoteTool(name, args) { const client = new Client( { name: "alai-mcp-wrapper", version: "1.0.2" }, { capabilities: {} }, ); const transport = new StreamableHTTPClientTransport(new URL(REMOTE_MCP_URL), { requestInit: { headers: createRemoteHeaders(), }, }); try { await client.connect(transport); return await client.callTool({ name, arguments: args, }); } finally { await transport.close().catch(() => {}); await client.close().catch(() => {}); } }