banner
Render text into large ASCII banners with FIGlet fonts for CLI headers, welcome messages, and titles.
Instructions
Render text as a large ASCII banner using FIGlet fonts. Great for CLI headers, welcome messages, and titles.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text to render (max 50 chars) | |
| font | No | Font: Standard (default), Small (compact), Slant (italic), Big (bold), Mini (minimal) | Standard |
Implementation Reference
- src/mcp.ts:119-130 (registration)The 'banner' tool is registered on the MCP server using server.tool() with name 'banner', description, Zod schema for 'text' (max 50 chars) and 'font' (enum of BANNER_FONTS), and an async handler.
server.tool( 'banner', 'Render text as a large ASCII banner using FIGlet fonts. Great for CLI headers, welcome messages, and titles.', { text: z.string().max(50).describe('Text to render (max 50 chars)'), font: z.enum(BANNER_FONTS).default('Standard').describe('Font: Standard (default), Small (compact), Slant (italic), Big (bold), Mini (minimal)'), }, async ({ text, font }) => { const banner = renderBanner(text, font); return { content: [{ type: 'text', text: banner }] }; } ); - src/mcp.ts:126-129 (handler)The handler function for the 'banner' tool: calls renderBanner(text, font) and returns the result as text content.
async ({ text, font }) => { const banner = renderBanner(text, font); return { content: [{ type: 'text', text: banner }] }; } - src/banner.ts:6-8 (helper)Core helper function renderBanner() that uses the 'figlet' library to render text synchronously into ASCII art with the specified font.
export function renderBanner(text: string, font: BannerFont = 'Standard'): string { return figlet.textSync(text, { font }); } - src/banner.ts:3-5 (schema)Type definitions: BANNER_FONTS constant array and BannerFont type alias. Defines the five supported FIGlet fonts: Standard, Small, Slant, Big, Mini.
export const BANNER_FONTS = ['Standard', 'Small', 'Slant', 'Big', 'Mini'] as const; export type BannerFont = (typeof BANNER_FONTS)[number]; - src/banner.ts:10-18 (helper)Helper function listBannerFonts() returns metadata about each supported font (name and description).
export function listBannerFonts(): { name: BannerFont; description: string }[] { return [ { name: 'Standard', description: 'Default balanced font' }, { name: 'Small', description: 'Compact, saves tokens' }, { name: 'Slant', description: 'Italic style' }, { name: 'Big', description: 'Bold emphasis' }, { name: 'Mini', description: 'Minimal 3-line font' }, ]; }