Skip to main content
Glama
iannuttall

Flux UI MCP Server

by iannuttall

get_flux_component_details

Retrieve detailed documentation and examples for specific Flux UI components to understand their usage and implementation.

Instructions

Get detailed information about a specific Flux UI component

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentNameYesName of the Flux UI component (e.g., "accordion", "button")

Implementation Reference

  • Main handler function for the get_flux_component_details tool. Validates input, checks cache, fetches component details from Flux UI docs if needed, caches the result, and returns formatted response.
    private async handleGetComponentDetails(args: any) {
      const componentName = this.validateComponentName(args);
    
      try {
        // Check cache first
        if (this.componentCache.has(componentName)) {
          const cachedData = this.componentCache.get(componentName);
           console.error(`Cache hit for ${componentName}`);
          return this.createSuccessResponse(cachedData);
        }
         console.error(`Cache miss for ${componentName}, fetching...`);
    
        // Fetch component details
        const componentInfo = await this.fetchComponentDetails(componentName);
    
        // Save to cache
        this.componentCache.set(componentName, componentInfo);
         console.error(`Cached details for ${componentName}`);
    
        return this.createSuccessResponse(componentInfo);
      } catch (error) {
         console.error(`Error fetching details for ${componentName}:`, error);
        // Ensure handleAxiosError is called correctly or rethrow McpError
        if (error instanceof McpError) {
          throw error;
        }
        this.handleAxiosError(error, `fetching details for component "${componentName}"`);
      }
    }
  • Input schema definition for the get_flux_component_details tool, specifying the required 'componentName' parameter.
    inputSchema: {
      type: "object",
      properties: {
        componentName: {
          type: "string",
          description: 'Name of the Flux UI component (e.g., "accordion", "button")',
        },
      },
      required: ["componentName"],
    },
  • src/index.ts:110-123 (registration)
    Tool registration in the list of available tools returned by ListToolsRequestSchema.
    {
      name: "get_flux_component_details",
      description: "Get detailed information about a specific Flux UI component",
      inputSchema: {
        type: "object",
        properties: {
          componentName: {
            type: "string",
            description: 'Name of the Flux UI component (e.g., "accordion", "button")',
          },
        },
        required: ["componentName"],
      },
    },
  • src/index.ts:159-160 (registration)
    Handler dispatch/registration in the CallToolRequestSchema switch statement.
    case "get_flux_component_details":
      return await this.handleGetComponentDetails(request.params.arguments);
  • Core helper function that fetches and parses the component details page using axios and cheerio, extracting title, description, examples, import statement, and props.
    private async fetchComponentDetails(componentName: string): Promise<ComponentInfo> {
      const componentUrl = `${this.FLUX_DOCS_URL}/components/${componentName}`;
       console.error(`Fetching URL: ${componentUrl}`);
      const response = await this.axiosInstance.get(componentUrl);
      const $ = cheerio.load(response.data);
       console.error(`Successfully loaded HTML for ${componentName}`);
    
      // Extract component information
      const title = $("h1").first().text().trim();
      const description = this.extractDescription($);
      const examples = this.extractExamples($); // Extract examples first to find import statement
      const importStatement = this.findImportStatement(examples);
      const props = this.extractProps($);
    
      console.error(`Extracted for ${componentName}: Title=${title}, Desc=${description.substring(0,50)}..., Import=${importStatement}, Props=${Object.keys(props).length}, Examples=${examples.length}`);
    
      return {
        name: title || componentName, // Use extracted title if available
        description,
        url: componentUrl,
        importStatement,
        props: Object.keys(props).length > 0 ? props : undefined,
        examples, // Include examples in details as well
      };
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Get detailed information') but doesn't mention whether this is a read-only operation, what format the information is returned in, potential errors (e.g., for invalid component names), or any rate limits. This leaves significant gaps in understanding how the tool behaves.

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

Conciseness4/5

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

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded with the core action, though it could be slightly more structured by hinting at the output or usage context.

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 the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'detailed information' includes (e.g., properties, usage guidelines, dependencies), nor does it address potential behavioral aspects like error handling. For a tool with no structured data beyond the input schema, this leaves the agent with insufficient context.

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?

The schema description coverage is 100%, with the parameter 'componentName' fully documented in the schema. The description adds no additional meaning beyond what the schema provides (e.g., it doesn't clarify what constitutes a valid component name beyond the examples). Given the high schema coverage, the baseline score of 3 is appropriate.

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

Purpose4/5

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

The description clearly states the verb ('Get detailed information') and resource ('specific Flux UI component'), making the purpose unambiguous. However, it doesn't differentiate from sibling tools like 'get_flux_component_examples' which might also provide component details, leaving room for confusion about what distinguishes them.

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 like 'list_flux_components' or 'search_flux_components'. It lacks any context about prerequisites, such as needing to know the exact component name, or exclusions, like not being suitable for browsing components.

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/iannuttall/flux-ui-mcp'

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