Skip to main content
Glama

get_typography

Retrieve typography specifications including font families, sizes, weights, line heights, and usage guidelines for design contexts like marketing or product. Output in JSON, CSS, or SCSS.

Instructions

Get typography specifications: font families, sizes, weights, line heights, and usage guidelines per context.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contextNoDesign context to queryall
formatNoOutput formatjson

Implementation Reference

  • The main handler function for the get_typography tool. Resolves the context (marketing/product/shared/all), retrieves typography from the index, and returns output in JSON, CSS, or SCSS format.
    export function handler(index: DesignSystemIndex, args: GetTypographyArgs) {
      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 typography = resolved.typography;
    
      if (typography.length === 0) {
        return [{ type: 'text' as const, text: `No typography specifications found in ${ctx} context.` }];
      }
    
      switch (args.format) {
        case 'css':
          return [{ type: 'text' as const, text: typographyToCSSFormat(typography) }];
        case 'scss':
          return [{ type: 'text' as const, text: typographyToSCSSFormat(typography) }];
        default:
          return [{ type: 'text' as const, text: JSON.stringify(typography, null, 2) }];
      }
    }
  • Input schema for get_typography: accepts a 'context' enum (marketing/product/shared/all) and a 'format' enum (json/css/scss).
    export const INPUT_SCHEMA = {
      type: 'object' as const,
      properties: {
        context: { type: 'string', enum: ['marketing', 'product', 'shared', 'all'], default: 'all', description: 'Design context to query' },
        format: { type: 'string', enum: ['json', 'css', 'scss'], default: 'json', description: 'Output format' },
      },
    };
  • TypeScript interface GetTypographyArgs defining the typed arguments: optional context and format string enums.
    /** Arguments for the `get_typography` MCP tool */
    export interface GetTypographyArgs {
      /** Filter typography styles to a specific design context */
      context?: 'marketing' | 'product' | 'shared' | 'all';
    
      /** Output format for the typography list */
      format?: 'json' | 'css' | 'scss';
    }
  • Registration of get_typography handler in the CallToolRequestSchema switch-case, dispatching to typography.handler when TOOL_NAME matches.
    case typography.TOOL_NAME:
      return { content: typography.handler(index, args as never) };
  • Registration of the tool in ListToolsRequestSchema: maps ALL_TOOLS (including typography) to name/description/inputSchema for discovery.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: ALL_TOOLS.map((t) => ({
        name: t.TOOL_NAME,
        description: t.TOOL_DESCRIPTION,
        inputSchema: t.INPUT_SCHEMA,
      })),
    }));
Behavior2/5

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

No annotations are provided, and the description offers no behavioral details beyond indicating it retrieves data. It does not mention authentication, rate limits, or data freshness, leaving the agent with minimal insight into side effects or constraints.

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?

A single sentence of 11 words that immediately conveys the tool's purpose and scope. No superfluous words or repetition.

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 tool is simple with two enum parameters and no output schema. The description lists the returned data types and mentions 'per context', which is adequate. It might briefly note default parameter values, but overall it is complete for its complexity.

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?

Input schema covers both parameters with descriptions (100% coverage). The description adds context by listing the spec elements retrieved (e.g., font families, sizes) and mentions 'per context', which ties to the context parameter. However, it does not enhance the format parameter, so the added value is moderate.

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 typography specifications, listing font families, sizes, weights, line heights, and usage guidelines per context. It distinguishes itself from siblings like get_colors or get_logos by specifying typography-specific content.

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 explicit guidance on when to use this tool versus alternatives like get_css or get_tokens. The description implies context-based usage but does not elaborate on selecting between contexts or other tools.

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