get_guidelines
Retrieve brand guidelines, voice and tone documentation, accessibility rules, and usage policies as full markdown content.
Instructions
Get brand guidelines, voice and tone documentation, accessibility rules, and usage policies. Returns full markdown content.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context | No | Design context to query | all |
| section | No | Filter by section: brand-voice, accessibility, logo-usage, typography, colors, general |
Implementation Reference
- src/tools/get-guidelines.ts:27-53 (handler)Main handler function for the get_guidelines tool. Resolves the design context (all/marketing/product), filters guidelines by optional section, and returns the matching guidelines as JSON.
export function handler(index: DesignSystemIndex, args: GetGuidelinesArgs) { 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; let guidelines = resolved.guidelines; if (args.section) { const section = args.section.toLowerCase(); guidelines = guidelines.filter((g) => g.section?.toLowerCase().includes(section) || g.title.toLowerCase().includes(section)); } if (guidelines.length === 0) { return [{ type: 'text' as const, text: `No guidelines found${args.section ? ` for section "${args.section}"` : ''} in ${ctx} context.` }]; } const output = guidelines.map((g) => ({ title: g.title, section: g.section, context: g.context, content: g.content, })); return [{ type: 'text' as const, text: JSON.stringify(output, null, 2) }]; } - src/tools/get-guidelines.ts:16-22 (schema)Input schema for the get_guidelines tool, defining the context and section filter parameters.
export const INPUT_SCHEMA = { type: 'object' as const, properties: { context: { type: 'string', enum: ['marketing', 'product', 'shared', 'all'], default: 'all', description: 'Design context to query' }, section: { type: 'string', description: 'Filter by section: brand-voice, accessibility, logo-usage, typography, colors, general' }, }, }; - src/types/mcp.ts:76-83 (schema)TypeScript type definition for GetGuidelinesArgs with optional context and section fields.
/** Arguments for the `get_guidelines` MCP tool */ export interface GetGuidelinesArgs { /** Filter guidelines to a specific design context */ context?: 'marketing' | 'product' | 'shared' | 'all'; /** Filter by guideline section (e.g. "brand-voice", "accessibility") */ section?: string; } - src/tools/index.ts:88-89 (registration)Registration of get_guidelines in the CallToolRequestSchema handler, dispatching to the guidelines module's handler.
case guidelines.TOOL_NAME: return { content: guidelines.handler(index, args as never) }; - src/tools/index.ts:24-24 (registration)Import of the get-guidelines module in the tools index for registration.
import * as guidelines from './get-guidelines.js';