helius_get_slot
Retrieve the current slot of the Solana blockchain using the MCP Helius server, with optional commitment levels for accuracy. Facilitates real-time blockchain data access and transaction processing.
Instructions
Get the current slot of the Solana blockchain
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| commitment | No |
Input Schema (JSON Schema)
{
"properties": {
"commitment": {
"enum": [
"confirmed",
"finalized",
"processed"
],
"type": "string"
}
},
"required": [],
"type": "object"
}
Implementation Reference
- src/handlers/helius.ts:150-157 (handler)The main handler function that implements the 'helius_get_slot' tool. It calls the Helius connection's getSlot method with the provided commitment level and returns the current slot.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/tools.ts:114-124 (schema)Defines the input schema for the 'helius_get_slot' tool, specifying optional commitment parameter.{ 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)Registers the getSlotHandler as the executor for the 'helius_get_slot' tool in the handlers dictionary."helius_get_slot": getSlotHandler,