Skip to main content
Glama

get_native_component

Retrieve accessibility criteria for native mobile components, including iOS/Android implementation details, platform properties, and code examples to ensure accessible development.

Instructions

Get detailed accessibility criteria for a specific native component. Returns iOS and Android implementation details, platform-specific properties, and code examples.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentYesComponent name (e.g., "button", "switch", "picker")
include_code_examplesNoInclude platform-specific code examples (default: true)

Implementation Reference

  • Primary execution handler for the 'get_native_component' tool. Fetches native component data from contentLoader, serializes to JSON, handles not-found errors with suggestions.
    async function handleGetNativeComponent(args: any) {
      try {
        const componentData = await contentLoader.getComponent('native', args.component);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(componentData, null, 2),
            },
          ],
        };
      } catch (error: any) {
        const suggestions = contentLoader.getSimilarComponents('native', args.component);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(
                {
                  error: 'Component not found',
                  component: args.component,
                  suggestions,
                },
                null,
                2
              ),
            },
          ],
          isError: true,
        };
      }
  • Tool schema definition: name, description, and inputSchema used for tool listing and validation.
    {
      name: 'get_native_component',
      description: 'Get detailed accessibility criteria for a specific native component. Returns iOS and Android implementation details, platform-specific properties, and code examples.',
      inputSchema: {
        type: 'object',
        properties: {
          component: {
            type: 'string',
            description: 'Component name (e.g., "button", "switch", "picker")',
          },
          include_code_examples: {
            type: 'boolean',
            description: 'Include platform-specific code examples (default: true)',
            default: true,
          },
        },
        required: ['component'],
      },
    },
  • src/index.ts:45-92 (registration)
    Tool dispatcher registration via setRequestHandler for CallToolRequestSchema, including the switch case that routes 'get_native_component' to its handler.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
    
      try {
        switch (name) {
          case 'list_web_components':
            return await handleListWebComponents(args);
          case 'get_web_component':
            return await handleGetWebComponent(args);
          case 'search_web_criteria':
            return await handleSearchWebCriteria(args);
          case 'list_native_components':
            return await handleListNativeComponents(args);
          case 'get_native_component':
            return await handleGetNativeComponent(args);
          case 'search_native_criteria':
            return await handleSearchNativeCriteria(args);
          case 'get_component_gherkin':
            return await handleGetComponentGherkin(args);
          case 'get_component_condensed':
            return await handleGetComponentCondensed(args);
          case 'get_component_developer_notes':
            return await handleGetComponentDeveloperNotes(args);
          case 'get_component_native_notes':
            return await handleGetComponentNativeNotes(args);
          case 'list_component_formats':
            return await handleListComponentFormats(args);
          default:
            throw new Error(`Unknown tool: ${name}`);
        }
      } catch (error: any) {
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(
                {
                  error: error.message || 'An error occurred',
                },
                null,
                2
              ),
            },
          ],
          isError: true,
        };
      }
    });
  • Secondary inline handler for 'get_native_component' in Netlify HTTP serverless function.
    case 'get_native_component': {
      const data = await contentLoader.getComponent('native', args.component);
      return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
    }
Behavior3/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 describes the return content (iOS/Android details, properties, code examples) and implies a read-only operation, but does not cover aspects like error handling, rate limits, authentication needs, or data freshness. It adds some value by specifying the scope of returned data, but misses key behavioral traits for a tool with no annotation coverage.

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, well-structured sentence that front-loads the purpose and efficiently lists return details without unnecessary words. Every part earns its place by clarifying the tool's function and output, making it highly concise and easy to parse.

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

Completeness3/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 2 parameters with full schema coverage, the description is adequate but incomplete. It covers the purpose and return scope, but lacks details on error cases, response format, or usage prerequisites. For a tool with no structured behavioral data, it should provide more context to be fully helpful.

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%, so the schema already fully documents both parameters ('component' and 'include_code_examples'). The description does not add any meaning beyond what the schema provides, such as explaining parameter interactions or providing examples not in the schema. Baseline 3 is appropriate when the schema does all the work.

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

Purpose5/5

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

The description clearly states the specific action ('Get detailed accessibility criteria') and target resource ('for a specific native component'), distinguishing it from siblings like 'get_component_condensed' or 'get_web_component' by specifying native components and detailed criteria. It explicitly mentions the return content (iOS/Android details, properties, code examples), making the purpose unambiguous and distinct.

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

Usage Guidelines3/5

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

The description implies usage for native components (vs. web components) and detailed criteria (vs. condensed versions), but does not explicitly state when to use this tool over alternatives like 'get_component_condensed' or 'search_native_criteria'. It provides some context through the return details, but lacks clear exclusions or named alternatives, leaving room for interpretation.

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/joe-watkins/magentaa11y-mcp-remote'

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