Skip to main content
Glama

get_theme_script

Retrieve JavaScript code to implement dark/light mode theme switching for web interfaces using Basecoat UI components.

Instructions

Get theme switcher script for dark/light mode

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that reads the theme script HTML from 'scripts/theme-script.html' and returns its trimmed content.
    async getThemeScript() {
      const themePath = path.join(__dirname, 'scripts', 'theme-script.html');
      try {
        const content = await fs.readFile(themePath, 'utf-8');
        return content.trim();
      } catch (error) {
        throw new Error(`Failed to read theme script: ${error.message}`);
      }
    }
  • Input schema for the 'get_theme_script' tool, which takes no parameters.
    inputSchema: {
      type: 'object',
      properties: {},
    },
  • server.js:213-220 (registration)
    Tool registration in the ListTools response, including name, description, and schema.
    {
      name: 'get_theme_script',
      description: 'Get theme switcher script for dark/light mode',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Dispatch handler in the CallToolRequestSchema switch that calls getThemeScript and formats the response as markdown.
    case 'get_theme_script': {
      const themeScript = await this.getThemeScript();
      return {
        content: [
          {
            type: 'text',
            text: `# Theme Switcher\n\nAdd this to enable dark/light mode switching:\n\n\`\`\`html\n${themeScript}\n\`\`\``,
          },
        ],
      };
    }
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 tool 'gets' a script, implying a read operation, but doesn't specify if it's safe, requires authentication, has side effects, or details the return format (e.g., JavaScript code, configuration). This leaves significant gaps for an agent to understand its behavior.

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 directly states the tool's purpose without any unnecessary words. It is front-loaded and wastes no space, making it highly concise and well-structured for quick understanding.

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 for a tool that likely returns code or configuration. It doesn't explain what the script does, its format, or how to use it, leaving the agent without enough context to effectively invoke or interpret results from this tool.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so the schema fully documents the lack of inputs. The description adds no parameter information, which is appropriate here, but it doesn't compensate for any gaps since there are none. A baseline of 4 is applied as it meets the requirement for zero parameters.

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 action ('Get') and the resource ('theme switcher script for dark/light mode'), making the purpose understandable. However, it doesn't explicitly differentiate this tool from its siblings like 'get_component' or 'get_setup', which might also retrieve code or configuration elements.

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, such as whether it's for initial setup, dynamic theming, or specific contexts. It lacks any mention of prerequisites, exclusions, or comparisons to sibling tools, leaving usage unclear.

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/GustavoGomezPG/basecoat-mcp'

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