denom_classify
Classify a token denomination string into its type: native, ibc, evm, move, cw20, factory, or l2, enabling token identification across blockchain ecosystems.
Instructions
Classify a token denomination into its type: native, ibc, evm, move, cw20, factory, or l2.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| denom | Yes | Token denomination string to classify |
Implementation Reference
- src/tools/denom.ts:7-17 (handler)The tool registration for 'denom_classify' including its handler. The handler calls getDenomType() from @initia/initia.js/util to classify the denomination string and returns the result.
registry.register({ name: 'denom_classify', group: 'denom', description: 'Classify a token denomination into its type: native, ibc, evm, move, cw20, factory, or l2.', schema: { denom: z.string().describe('Token denomination string to classify') }, annotations: { readOnlyHint: true }, handler: async ({ denom }) => { const denomType = getDenomType(denom); return success({ denom, type: denomType }); }, }); - src/tools/denom.ts:11-11 (schema)Input schema: requires a single 'denom' string parameter describing the token denomination to classify.
schema: { denom: z.string().describe('Token denomination string to classify') }, - src/tools/denom.ts:7-17 (registration)Registration via registry.register() with name 'denom_classify', group 'denom', and readOnlyHint annotation.
registry.register({ name: 'denom_classify', group: 'denom', description: 'Classify a token denomination into its type: native, ibc, evm, move, cw20, factory, or l2.', schema: { denom: z.string().describe('Token denomination string to classify') }, annotations: { readOnlyHint: true }, handler: async ({ denom }) => { const denomType = getDenomType(denom); return success({ denom, type: denomType }); }, }); - src/tools/registry.ts:36-47 (registration)The ToolRegistry.register() method that stores the tool definition after wrapping handlers with address normalization and coin formatting if configured.
register<T extends ZodShape>(def: ToolDef<T>): void { if (this.tools.has(def.name)) { throw new Error(`Tool '${def.name}' is already registered`); } if (def.addressFields) { (def as any).handler = withAddressNormalization(def.handler as any, def.addressFields); } if (def.formatCoins) { (def as any).handler = withCoinFormatting(def.handler as any, def.formatCoins); } this.tools.set(def.name, def as ToolDef); } - src/response.ts:15-17 (helper)The success() helper used to format the handler's response as JSON text content.
export function success(data: unknown): CallToolResult { return { content: [{ type: 'text', text: JSON.stringify(data, safeReplacer(), 2) }] }; }