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,
      },
    },

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.0

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, so the safety profile is covered. The description adds no extra behavioral details (e.g., pagination, sorting, or response format), but for a simple parameterless list operation this does not create a significant gap. The description neither contradicts annotations nor enriches them beyond the basic read-only nature.

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 sentence, using exactly the words needed to convey the purpose. There is no fluff or repetition, making it optimally concise and well-structured for a simple tool.

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?

Given the tool's simplicity (no parameters, no output schema, basic list operation), the description is complete enough for an agent to understand the function. It does not specify the return format, but the practical nature of a theme list makes this self-evident, so minimal detail is acceptable.

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?

There are zero parameters, and schema coverage is trivially 100%. Per rubric, a baseline of 4 applies when no parameters exist; the description correctly adds no parameter explanations since there are none to describe.

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 uses a specific verb 'List' and names the resource 'tweakcn themes', clearly indicating it enumerates available themes. It naturally distinguishes from sibling tools like get_theme, which retrieves a single theme, without needing explicit differentiation.

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?

No guidance is provided on when to use this tool versus alternatives such as get_theme or list_components. The description only states what it does, with no context on typical use cases, prerequisites, or exclusions. It is not misleading but lacks any usage direction.

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