helius_get_slot
Retrieve the current slot number of the Solana blockchain. Specify commitment level for confirmed, finalized, or processed states.
Instructions
Get the current slot of the Solana blockchain
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "helius_get_slot"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| commitment | No |
Implementation Reference
- src/handlers/helius.ts:150-157 (handler)Main handler function for helius_get_slot. Calls connection.getSlot() with optional commitment parameter and returns the current Solana slot number.
export const getSlotHandler = async (input: GetSlotInput): Promise<ToolResultSchema> => { try { const slot = await (helius as any as Helius).connection.getSlot(input.commitment); return createSuccessResponse(`Current slot: ${slot}`); } catch (error) { return createErrorResponse(`Error getting slot: ${error instanceof Error ? error.message : String(error)}`); } } - src/handlers/helius.types.ts:77-79 (schema)Input type definition for GetSlotInput with optional commitment field.
export type GetSlotInput = { commitment?: "confirmed" | "finalized" | "processed"; } - src/handlers/helius.types.ts:81-83 (schema)Output type definition for GetSlotOutput.
export type GetSlotOutput = { slot: number; } - src/tools.ts:114-124 (registration)Tool schema registration defining name, description, and inputSchema for helius_get_slot.
{ name: "helius_get_slot", description: "Get the current slot of the Solana blockchain", inputSchema: { type: "object", properties: { commitment: { type: "string", enum: ["confirmed", "finalized", "processed"] } }, required: [] } }, - src/tools.ts:557-557 (registration)Handler registration mapping 'helius_get_slot' to getSlotHandler in the handlers export.
"helius_get_slot": getSlotHandler,