Skip to main content
Glama
Jpisnice

@jpisnice/shadcn-ui-mcp-server

by Jpisnice

list_themes

Read-only

Lists all available tweakcn themes for shadcn UI components.

Instructions

List available tweakcn themes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function 'handleListThemes' that executes the tool logic - fetches themes from GitHub presets URL, filters by optional query, and returns results as JSON text.
    export async function handleListThemes(args: z.infer<z.ZodObject<typeof schema>>) {
      try {
        const presets = await fetchPresetsFromGithub(DEFAULT_PRESETS_URL);
        
        let results = Object.entries(presets).map(([id, theme]) => ({
          id,
          label: theme.label || theme.name || id,
          createdAt: theme.createdAt,
          // description: theme.description || "No description available",
        }));
    
        if (args.query) {
          const q = args.query.toLowerCase();
          results = results.filter(
            (t) =>
              t.id.toLowerCase().includes(q) ||
              t.label.toLowerCase().includes(q)
          );
        }
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(results, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error listing themes: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Zod schema defining the input parameter 'query' (optional string) for filtering themes.
    export const schema = {
      query: z.string().optional().describe("Search query to filter themes"),
    };
  • Import and registration of list_themes handler/schema in the toolHandlers and toolSchemas maps.
    import { handleListThemes, schema as listThemesSchema } from './tweakcn/list-themes.js';
    import { handleGetTheme, schema as getThemeSchema } from './tweakcn/get-theme.js';
    
    import { schema as getComponentSchema } from './components/get-component.js';
    import { schema as getComponentDemoSchema } from './components/get-component-demo.js';
    import { schema as listComponentsSchema } from './components/list-components.js';
    import { schema as getComponentMetadataSchema } from './components/get-component-metadata.js';
    import { schema as getDirectoryStructureSchema } from './repository/get-directory-structure.js';
    import { schema as getBlockSchema } from './blocks/get-block.js';
    import { schema as listBlocksSchema } from './blocks/list-blocks.js';
    
    export const toolHandlers = {
      get_component: handleGetComponent,
      get_component_demo: handleGetComponentDemo,
      list_components: handleListComponents,
      get_component_metadata: handleGetComponentMetadata,
      get_directory_structure: handleGetDirectoryStructure,
      get_block: handleGetBlock,
      list_blocks: handleListBlocks,
      apply_theme: handleApplyTheme,
      list_themes: handleListThemes,
      get_theme: handleGetTheme
    };
  • Tool definition with name, description ('List available tweakcn themes'), and inputSchema referencing listThemesSchema.
    'list_themes': {
      name: 'list_themes',
      description: 'List available tweakcn themes',
      inputSchema: {
        type: 'object',
        properties: listThemesSchema
      }
    },
  • Server tool registration in list of registered tools, with readOnlyHint annotation.
    {
      name: 'list_themes',
      description: 'List available tweakcn themes',
      inputSchema: {
        type: 'object',
        properties: {},
      },
      annotations: {
        title: "List Themes",
        readOnlyHint: true,
      },
    },
Behavior2/5

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

The description adds no behavioral context beyond the annotation readOnlyHint=true. It does not disclose pagination, caching, or any side effects.

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 concise sentence with no wasted words, front-loaded with the action.

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

Completeness4/5

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

The description covers the essential purpose for a simple listing tool with no parameters. It could specify output details (e.g., returns theme names), but overall it is adequate.

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?

With zero parameters, the schema is fully covered. The description adds no further parameter meaning, but none is needed.

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 tool lists available tweakcn themes, using a specific verb and resource. It is distinct from sibling tools like get_theme (single theme) and apply_theme (action).

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 does not provide guidance on when to use this tool versus alternatives like get_theme for details. However, for a straightforward list operation, the purpose is clear enough.

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/Jpisnice/shadcn-ui-mcp-server'

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