get_lighter_instrument
Get market details for a Lighter.xyz instrument by coin symbol: market ID, fees, decimals, and active status.
Instructions
Get details for a single Lighter.xyz instrument by coin symbol. Returns market ID, fees, size/price decimals, and active status.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coin | Yes | Lighter.xyz coin symbol, e.g. 'BTC', 'ETH' |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Result data object |
Implementation Reference
- src/index.ts:783-789 (registration)Registration of the tool 'get_lighter_instrument' via registerCurrentTool helper. It uses LighterCoinParam for input schema, calls api().lighter.instruments.get(coin) as the handler, and normalizes the coin with normalizeLighterCoin.
registerCurrentTool( "get_lighter_instrument", "Get details for a single Lighter.xyz instrument by coin symbol. Returns market ID, fees, size/price decimals, and active status.", (coin) => api().lighter.instruments.get(coin), LighterCoinParam, normalizeLighterCoin ); - src/index.ts:373-384 (handler)The generic handler function (registerCurrentTool) that wraps the actual SDK call. For get_lighter_instrument, this becomes: normalizes the coin with normalizeLighterCoin, calls api().lighter.instruments.get(coin), and formats the response.
function registerCurrentTool( name: string, description: string, sdkCall: (coin: string) => Promise<unknown>, coinSchema: z.ZodString, normFn: (coin: string) => string ): void { registerTool(name, description, { coin: coinSchema }, ObjectOutputSchema, async (params) => { const data = await sdkCall(normFn(params.coin)); return formatResponse(data); }); } - src/index.ts:73-75 (schema)Input schema param for the Lighter coin symbol. Defines a simple string parameter described as 'Lighter.xyz coin symbol, e.g. BTC, ETH'.
const LighterCoinParam = z .string() .describe("Lighter.xyz coin symbol, e.g. 'BTC', 'ETH'"); - src/index.ts:316-318 (helper)Normalizes the Lighter coin symbol to uppercase before passing to the SDK call.
function normalizeLighterCoin(coin: string): string { return coin.toUpperCase(); }