lorem_ipsum
Generate placeholder text for design mockups and content layouts. Specify paragraphs, sentences, or words with customizable counts to fill spaces during development.
Instructions
Generate Lorem Ipsum placeholder text.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Type of output: paragraphs, sentences, or words | paragraphs |
| count | No | Number of paragraphs/sentences/words to generate |
Implementation Reference
- src/tools/text.ts:62-112 (handler)The handler implementation for the `lorem_ipsum` tool, which generates placeholder text based on requested type (paragraphs, sentences, or words) and count.
async ({ type, count }) => { const loremWords = [ "lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit", "sed", "do", "eiusmod", "tempor", "incididunt", "ut", "labore", "et", "dolore", "magna", "aliqua", "enim", "ad", "minim", "veniam", "quis", "nostrud", "exercitation", "ullamco", "laboris", "nisi", "aliquip", "ex", "ea", "commodo", "consequat", "duis", "aute", "irure", "in", "reprehenderit", "voluptate", "velit", "esse", "cillum", "fugiat", "nulla", "pariatur", "excepteur", "sint", "occaecat", "cupidatat", "non", "proident", "sunt", "culpa", "qui", "officia", "deserunt", "mollit", "anim", "id", "est", "laborum", "at", "vero", "eos", "accusamus", "iusto", "odio", "dignissimos", "ducimus", "blanditiis", "praesentium", "voluptatum", "deleniti", "atque", "corrupti", "quos", "dolores", "quas", "molestias", "excepturi", "obcaecati", "cupiditate", "provident", "similique", "explicabo", "nemo", "ipsam", "voluptatem", "quia", "voluptas", "aspernatur", "aut", "odit", "fugit", "consequuntur", "magni", ]; const randomWord = (i: number): string => loremWords[(i * 7 + 13) % loremWords.length]; const generateSentence = (idx: number): string => { const length = 8 + (idx % 7); const words = Array.from({ length }, (_, i) => randomWord(idx * 20 + i)); words[0] = words[0].charAt(0).toUpperCase() + words[0].slice(1); return words.join(" ") + "."; }; const generateParagraph = (idx: number): string => { const sentenceCount = 4 + (idx % 4); return Array.from({ length: sentenceCount }, (_, i) => generateSentence(idx * 10 + i) ).join(" "); }; let text: string; if (type === "words") { text = Array.from({ length: count }, (_, i) => randomWord(i)).join(" "); } else if (type === "sentences") { text = Array.from({ length: count }, (_, i) => generateSentence(i) ).join(" "); } else { text = Array.from({ length: count }, (_, i) => generateParagraph(i) ).join("\n\n"); } return { content: [{ type: "text" as const, text }] }; } - src/tools/text.ts:45-61 (registration)The registration of the `lorem_ipsum` tool using `server.tool` and schema definition for its inputs.
// Lorem Ipsum generator server.tool( "lorem_ipsum", "Generate Lorem Ipsum placeholder text.", { type: z .enum(["paragraphs", "sentences", "words"]) .default("paragraphs") .describe("Type of output: paragraphs, sentences, or words"), count: z .number() .int() .min(1) .max(50) .default(3) .describe("Number of paragraphs/sentences/words to generate"), },