Skip to main content
Glama

get_platform_usage

Retrieve platform-specific implementation instructions for Hugeicons integration across React, Vue, Angular, Svelte, React Native, Flutter, and HTML frameworks.

Instructions

Get platform-specific usage instructions for Hugeicons

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
platformYesPlatform name (react, vue, angular, svelte, react-native, flutter, html)

Implementation Reference

  • The main handler function for the get_platform_usage tool. It validates the input platform, retrieves the corresponding usage data from PLATFORM_USAGE, and returns it as JSON text content.
    private async handleGetPlatformUsage(args: any) {
      try {
        const platform = this.validatePlatform(args);
        const usage = PLATFORM_USAGE[platform];
    
        if (!usage) {
          throw new McpError(
            ErrorCode.InvalidRequest,
            `Platform '${platform}' is not supported`
          );
        }
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(usage, null, 2),
            },
          ],
        };
      } catch (error) {
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to get platform usage: ${error instanceof Error ? error.message : "Unknown error"}`
        );
      }
    }
  • Input schema for the get_platform_usage tool, defining the required 'platform' parameter with an enum of supported platforms.
    inputSchema: {
      type: "object",
      properties: {
        platform: {
          type: "string",
          description: "Platform name (react, vue, angular, svelte, react-native, flutter, html)",
          enum: ["react", "vue", "angular", "svelte", "react-native", "flutter", "html"]
        },
      },
      required: ["platform"],
    },
  • src/index.ts:94-108 (registration)
    Registration of the get_platform_usage tool in the ListToolsRequestSchema response, including name, description, and input schema.
    {
      name: "get_platform_usage",
      description: "Get platform-specific usage instructions for Hugeicons",
      inputSchema: {
        type: "object",
        properties: {
          platform: {
            type: "string",
            description: "Platform name (react, vue, angular, svelte, react-native, flutter, html)",
            enum: ["react", "vue", "angular", "svelte", "react-native", "flutter", "html"]
          },
        },
        required: ["platform"],
      },
    },
  • Helper function validatePlatform used by the handler to validate and normalize the platform input against supported keys in PLATFORM_USAGE.
    /**
     * Validate the platform argument
     */
    private validatePlatform(args: any): Platform {
      if (!args || typeof args.platform !== "string" || !args.platform.trim()) {
        throw new McpError(
          ErrorCode.InvalidRequest,
          "Platform must be a non-empty string"
        );
      }
    
      const platform = args.platform.trim().toLowerCase() as Platform;
      if (!Object.keys(PLATFORM_USAGE).includes(platform)) {
        throw new McpError(
          ErrorCode.InvalidRequest,
          `Invalid platform. Supported platforms are: ${Object.keys(PLATFORM_USAGE).join(', ')}`
        );
      }
    
      return platform;
    }
  • Core data structure PLATFORM_USAGE containing platform-specific installation instructions, usage examples, and props for all supported platforms, used directly by the tool handler.
    export const PLATFORM_USAGE: Record<Platform, PlatformUsage> = {
      'react': {
        platform: 'react',
        installation: {
          core: 'npm install @hugeicons/react',
          packages: CORE_PACKAGES
        },
        basicUsage: `import { HugeiconsIcon } from '@hugeicons/react'
    // Using free icons (available by default)
    import { Notification03Icon } from '@hugeicons/core-free-icons'
    // Pro icons require authentication via .npmrc or similar config
    // import { Notification03Icon } from '@hugeicons-pro/core-stroke-rounded'
    
    function App() {
        return <HugeiconsIcon icon={Notification03Icon} size={24} color="currentColor" strokeWidth={1.5} />
    }`,
        props: [
          { name: 'icon', type: 'IconSvgObject', default: 'Required', description: 'The main icon component imported from an icon package' },
          { name: 'altIcon', type: 'IconSvgObject', description: 'Alternative icon component from an icon package for states, interactions, or animations' },
          { name: 'showAlt', type: 'boolean', default: 'false', description: 'When true, displays the altIcon instead of the main icon' },
          { name: 'size', type: 'number', default: '24', description: 'Icon size in pixels' },
          { name: 'color', type: 'string', default: 'currentColor', description: 'Icon color (CSS color value)' },
          { name: 'strokeWidth', type: 'number', default: '1.5', description: 'Width of the icon strokes (works with stroke-style icons)' },
          { name: 'className', type: 'string', description: 'Additional CSS classes' }
        ]
      },
      'vue': {
        platform: 'vue',
        installation: {
          core: 'npm install @hugeicons/vue',
          packages: CORE_PACKAGES
        },
        basicUsage: `<script setup>
    import { HugeiconsIcon } from '@hugeicons/vue'
    // Using free icons (available by default)
    import { Notification03Icon } from '@hugeicons/core-free-icons'
    // Pro icons require authentication via .npmrc or similar config
    // import { Notification03Icon } from '@hugeicons-pro/core-stroke-rounded'
    </script>
    
    <template>
        <HugeiconsIcon :icon="Notification03Icon" :size="24" color="currentColor" :strokeWidth="1.5" />
    </template>`,
        props: [
          { name: 'icon', type: 'IconSvgObject', default: 'Required', description: 'The main icon component imported from an icon package' },
          { name: 'altIcon', type: 'IconSvgObject', description: 'Alternative icon component from an icon package for states, interactions, or animations' },
          { name: 'showAlt', type: 'boolean', default: 'false', description: 'When true, displays the altIcon instead of the main icon' },
          { name: 'size', type: 'number', default: '24', description: 'Icon size in pixels' },
          { name: 'color', type: 'string', default: 'currentColor', description: 'Icon color (CSS color value)' },
          { name: 'strokeWidth', type: 'number', default: '1.5', description: 'Width of the icon strokes (works with stroke-style icons)' },
          { name: 'class', type: 'string', description: 'Additional CSS classes' }
        ]
      },
      'angular': {
        platform: 'angular',
        installation: {
          core: 'npm install @hugeicons/angular',
          packages: CORE_PACKAGES
        },
        basicUsage: `// your.component.ts
    import { Component } from '@angular/core'
    // Using free icons (available by default)
    import { Notification03Icon } from '@hugeicons/core-free-icons'
    // Pro icons require authentication via .npmrc or similar config
    // import { Notification03Icon } from '@hugeicons-pro/core-stroke-rounded'
    
    @Component({
        selector: 'app-example',
        template: \` <hugeicons-icon [icon]="notification03Icon" [size]="24" color="currentColor" [strokeWidth]="1.5"></hugeicons-icon> \`,
    })
    export class ExampleComponent {
        notification03Icon = Notification03Icon
    }`,
        props: [
          { name: 'icon', type: 'IconSvgObject', default: 'Required', description: 'The main icon component imported from an icon package' },
          { name: 'altIcon', type: 'IconSvgObject', description: 'Alternative icon component from an icon package for states, interactions, or animations' },
          { name: 'showAlt', type: 'boolean', default: 'false', description: 'When true, displays the altIcon instead of the main icon' },
          { name: 'size', type: 'number', default: '24', description: 'Icon size in pixels' },
          { name: 'color', type: 'string', default: 'currentColor', description: 'Icon color (CSS color value)' },
          { name: 'strokeWidth', type: 'number', default: '1.5', description: 'Width of the icon strokes (works with stroke-style icons)' },
          { name: 'class', type: 'string', description: 'Additional CSS classes' }
        ]
      },
      'svelte': {
        platform: 'svelte',
        installation: {
          core: 'npm install @hugeicons/svelte',
          packages: CORE_PACKAGES
        },
        basicUsage: `<script>
      import { HugeiconsIcon } from '@hugeicons/svelte'
      // Using free icons (available by default)
      import { Notification03Icon } from '@hugeicons/core-free-icons'
      // Pro icons require authentication via .npmrc or similar config
      // import { Notification03Icon } from '@hugeicons-pro/core-stroke-rounded'
    </script>
    
    <HugeiconsIcon icon={Notification03Icon} size={24} color="currentColor" strokeWidth={1.5} />`,
        props: [
          { name: 'icon', type: 'IconSvgObject', default: 'Required', description: 'The main icon component imported from an icon package' },
          { name: 'altIcon', type: 'IconSvgObject', description: 'Alternative icon component from an icon package for states, interactions, or animations' },
          { name: 'showAlt', type: 'boolean', default: 'false', description: 'When true, displays the altIcon instead of the main icon' },
          { name: 'size', type: 'number', default: '24', description: 'Icon size in pixels' },
          { name: 'color', type: 'string', default: 'currentColor', description: 'Icon color (CSS color value)' },
          { name: 'strokeWidth', type: 'number', default: '1.5', description: 'Width of the icon strokes (works with stroke-style icons)' },
          { name: 'class', type: 'string', description: 'Additional CSS classes' }
        ]
      },
      'react-native': {
        platform: 'react-native',
        installation: {
          core: 'npm install @hugeicons/react-native',
          packages: CORE_PACKAGES
        },
        basicUsage: `import { HugeiconsIcon } from '@hugeicons/react-native'
    // Using free icons (available by default)
    import { Notification03Icon } from '@hugeicons/core-free-icons'
    // Pro icons require authentication via .npmrc or similar config
    // import { Notification03Icon } from '@hugeicons-pro/core-stroke-rounded'
    
    export default function App() {
      return <HugeiconsIcon icon={Notification03Icon} size={24} color="#000000" strokeWidth={1.5} />
    }`,
        props: [
          { name: 'icon', type: 'IconSvgObject', default: 'Required', description: 'The main icon component imported from an icon package' },
          { name: 'altIcon', type: 'IconSvgObject', description: 'Alternative icon component from an icon package for states, interactions, or animations' },
          { name: 'showAlt', type: 'boolean', default: 'false', description: 'When true, displays the altIcon instead of the main icon' },
          { name: 'size', type: 'number', default: '24', description: 'Icon size in pixels' },
          { name: 'color', type: 'string', default: '#000000', description: 'Icon color (color string)' },
          { name: 'strokeWidth', type: 'number', default: '1.5', description: 'Width of the icon strokes (works with stroke-style icons)' }
        ]
      },
      'flutter': {
        platform: 'flutter',
        installation: {
          core: 'hugeicons: ^0.0.10',
          packages: []
        },
        basicUsage: `import 'package:hugeicons/hugeicons.dart';
    
    // Example usage in a widget
    HugeIcon(
      icon: HugeIcons.strokeRoundedHome01,
      color: Colors.red,
      size: 30.0,
    ),`,
        props: [
          { name: 'icon', type: 'HugeIcons', default: 'Required', description: 'The icon to display from HugeIcons collection' },
          { name: 'size', type: 'double', default: '24.0', description: 'Icon size in logical pixels' },
          { name: 'color', type: 'Color', default: 'Colors.black', description: 'Icon color from Flutter Colors' }
        ]
      },
      'html': {
        platform: 'html',
        installation: {
          core: 'CDN Link: https://use.hugeicons.com/font/icons.css',
          packages: []
        },
        basicUsage: `<!DOCTYPE html>
    <html>
        <head>
            <title>Hugeicons Example</title>
            <meta charset="UTF-8" />
            <link rel="stylesheet" href="https://use.hugeicons.com/font/icons.css" />
        </head>
        <body>
            <div class="icons">
                <ul>
                    <li>
                        <i class="hgi-stroke hgi-abacus"></i>
                        <p>abacus</p>
                    </li>
                    <li>
                        <i class="hgi-stroke hgi-absolute"></i>
                        <p>absolute</p>
                    </li>
                    <li>
                        <i class="hgi-stroke hgi-acceleration"></i>
                        <p>acceleration</p>
                    </li>
                    <li>
                        <i class="hgi-stroke hgi-access"></i>
                        <p>access</p>
                    </li>
                </ul>
            </div>
        </body>
    </html>`,
        props: [
          { name: 'class', type: 'string', default: 'hgi-stroke', description: 'Base CSS class for stroke-style icons' },
          { name: 'icon-name', type: 'string', default: 'Required', description: 'Specific icon class name (e.g., hgi-abacus, hgi-absolute)' },
          { name: 'style', type: 'CSS properties', description: 'Custom CSS styles for size, color, etc.' }
        ]
      }
    }; 
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. It states the tool 'gets' instructions, implying a read-only operation, but doesn't clarify if it requires authentication, has rate limits, returns structured data vs. text, or handles errors. For a tool with no annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose without unnecessary words. It directly states the action ('Get'), target ('platform-specific usage instructions'), and subject ('Hugeicons'), with zero redundancy or fluff. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a single parameter with full schema coverage, the description is incomplete. It doesn't explain what the output looks like (e.g., text, JSON, examples), how to interpret results, or error handling. For a tool that presumably returns instructional content, more context on the return format is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the parameter 'platform' fully documented in the schema including its enum values. The description doesn't add any parameter semantics beyond what the schema provides, such as explaining what 'usage instructions' mean for each platform or default behaviors. Baseline 3 is appropriate since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool's purpose as retrieving 'platform-specific usage instructions for Hugeicons', which is clear but vague. It specifies the resource ('usage instructions') and target ('Hugeicons'), but lacks detail on what these instructions entail or how they differ from general documentation. It distinguishes from siblings by focusing on platform guidance rather than icon retrieval, but could be more specific about the output format or content scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context for platform selection, or how it relates to sibling tools like list_icons or search_icons. Without explicit when/when-not instructions or named alternatives, users must infer usage from the purpose alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hugeicons/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server