Skip to main content
Glama

get_css

Retrieve raw CSS file contents and custom property definitions from your design system. Filter by design context to get only relevant styles.

Instructions

Get raw CSS file contents and extracted custom property definitions from the design system.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contextNoDesign context to queryall
includeRawNoInclude full raw CSS file contents (can be large)

Implementation Reference

  • Main handler for get_css tool: resolves design context, extracts CSS files with custom properties/classes, optionally includes raw content.
    /**
     * Handles the get_css tool call.
     */
    export function handler(index: DesignSystemIndex, args: GetCSSArgs) {
      const ctx = args.context ?? 'all';
      const resolved = ctx === 'all' ? index.resolved.all :
        ctx === 'marketing' ? index.resolved.marketing :
        ctx === 'product' ? index.resolved.product :
        index.resolved.all;
    
      const cssFiles = resolved.cssFiles;
    
      if (cssFiles.length === 0) {
        return [{ type: 'text' as const, text: `No CSS files found in ${ctx} context.` }];
      }
    
      const output = cssFiles.map((f) => ({
        filePath: f.filePath,
        customProperties: f.customProperties,
        classes: f.classes,
        ...(args.includeRaw ? { rawContent: f.rawContent } : {}),
      }));
    
      return [{ type: 'text' as const, text: JSON.stringify(output, null, 2) }];
    }
  • TypeScript type definition for get_css tool arguments (context and includeRaw).
    /** Arguments for the `get_css` MCP tool */
    export interface GetCSSArgs {
      /** Filter CSS files to a specific design context */
      context?: 'marketing' | 'product' | 'shared' | 'all';
    
      /** When true, include the full raw CSS text in the response */
      includeRaw?: boolean;
    }
  • Input JSON Schema for get_css tool, defining context enum and includeRaw boolean.
    export const INPUT_SCHEMA = {
      type: 'object' as const,
      properties: {
        context: { type: 'string', enum: ['marketing', 'product', 'shared', 'all'], default: 'all', description: 'Design context to query' },
        includeRaw: { type: 'boolean', default: false, description: 'Include full raw CSS file contents (can be large)' },
      },
    };
  • Registration of get_css handler in the CallToolRequestSchema switch statement.
    case css.TOOL_NAME:
      return { content: css.handler(index, args as never) };
  • Import of the get-css module into the tools registry.
    import * as css from './get-css.js';
    import * as searchBrand from './search-brand.js';
Behavior2/5

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

Without annotations, the description should disclose behavioral traits. It does not warn that includeRaw=true can return large data, nor explain what 'extracted custom property definitions' means in terms of output structure. No details on performance or 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.

Conciseness4/5

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

The description is a single sentence with no unnecessary words. It is front-loaded with the action 'Get'. However, it could benefit from more details without losing conciseness.

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 no output schema and no annotations, the description is insufficient. It does not mention return structure, error conditions, or scope limitations. For a tool with moderate complexity, this leaves gaps for the agent.

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 coverage is 100%, so baseline is 3. The description adds no extra meaning beyond the schema; it implies inclusion of raw CSS and custom properties but does not explicitly map to parameters or clarify the output.

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 retrieves raw CSS file contents and custom property definitions from the design system. This specific verb-resource combination distinguishes it from sibling tools like get_tokens or get_colors.

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 like get_tokens or get_typography. The description does not mention scenarios suited for raw CSS retrieval or exclusions.

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/ejwhite7/brandkit-mcp'

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