pine_ping
Verify connectivity with a PINE-compatible emulator by requesting its version string. Confirms reachability.
Instructions
Verify the PINE connection by querying the emulator version. Returns the version string if reachable.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools.ts:180-183 (handler)The handler for the pine_ping tool. Calls pine.getVersion() and returns "OK — emulator: <version>".
case "pine_ping": { const v = await pine.getVersion(); return ok(`OK — emulator: ${v}`); } - src/tools.ts:21-25 (schema)Tool definition with name "pine_ping", description, and empty inputSchema (no parameters).
{ name: "pine_ping", description: "Verify the PINE connection by querying the emulator version. Returns the version string if reachable.", inputSchema: { type: "object", properties: {} }, }, - src/tools.ts:174-183 (registration)The CallToolRequestSchema handler where pine_ping is handled as a case in the switch statement inside registerTools().
server.setRequestHandler(CallToolRequestSchema, async (req) => { const { name, arguments: args = {} } = req.params; const p = args as Record<string, unknown>; const addr = () => p.address as number; switch (name) { case "pine_ping": { const v = await pine.getVersion(); return ok(`OK — emulator: ${v}`); } - src/pine.ts:262-268 (helper)The getVersion() method on PineClient delegates to readString(Op.Version) which sends opcode 0x08 (Version) over PINE protocol.
private async readString(opcode: Opcode): Promise<string> { const r = await this.call(opcode); const len = r.readUInt32LE(0); return r.subarray(4, 4 + len).toString("utf8").replace(/\0+$/, ""); } async getVersion(): Promise<string> { return this.readString(Op.Version); } - src/pine.ts:34-36 (helper)The Version opcode definition (0x08) used by the pine_ping handler.
Version: 0x08, SaveState: 0x09, LoadState: 0x0A,