Skip to main content
Glama
mrseanchow

Cowsay MCP Server

by mrseanchow

cowthink

Generate ASCII art of a thinking cow with custom messages. Use various characters like dragons, penguins, or skeletons to create fun text-based art for documentation or entertainment.

Instructions

Generate ASCII art of a cow thinking something.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cowNoThe cow character to use.default
messageYesThe message for the cow to think.What to think about?

Implementation Reference

  • The registered handler function for the 'cowthink' tool. It validates server access, normalizes the input message and character based on config, calls the generateCowthink helper, and returns the result as MCP content.
    }, async ({ message, character }) => {
        // Validate server access
        if (!validateServerAccess(config.serverToken)) {
            throw new Error("Server access validation failed. Please provide a valid serverToken.");
        }
        // Apply user preferences from config
        const searchText = config.caseSensitive ? message : message.toLowerCase();
        const searchChar = config.caseSensitive ? character : character.toLowerCase();
        // Count occurrences of the specific character
        const result = await generateCowthink(searchText, searchChar);
        return {
            content: [
                {
                    type: "text",
                    text: result
                }
            ],
        };
    })
  • Core helper function that generates the cowthink ASCII art. Primarily uses npx cowsay with -T '\' option, falls back to cowsay.think library.
    export async function generateCowthink(message: string, cow: string): Promise<string> {
        try {
            const cowOption = cow !== 'default' ? `-f ${cow}` : '';
            const escapedMessage = message.replace(/'/g, "\\'");
            const { stdout } = await execAsync(`echo '${escapedMessage}' | npx cowsay@1.6.0 -T '\\' ${cowOption}`);
            return stdout;
        } catch (error) {
            try {
                const options = cow !== 'default' ? { f: cow } : {};
                return cowsay.think({ text: message, ...options });
            } catch (err) {
                throw new Error(`Failed to generate cowthink output: ${err instanceof Error ? err.message : String(err)}`);
            }
        }
    }
  • Detailed TypeScript type definition (Tool schema) for the cowthink tool, including all possible input parameters for cowsay think mode.
    export const COWTHINK: Tool = {
      name: 'cowthink',
      title: 'Cow Think',
      description: 'Generate ASCII art of a cow thinking something.',
      inputSchema: {
        type: 'object',
        properties: {
          message: {
            type: 'string',
            description: 'The message for the cow to think.',
            default: 'What to think about?'
          },
          character: {
            type: 'string',
            description: 'The cow character to use.',
            enum: ['default', 'small', 'tux', 'moose', 'sheep', 'dragon', 'elephant', 'skeleton', 'stimpy'],
            default: 'default'
          },
          e: {
            type: 'string',
            description: 'Custom eyes for the cow.',
            default: 'oo'
          },
          T: {
            type: 'string',
            description: 'Custom tongue for the cow.'
          },
          r: {
            type: 'boolean',
            description: 'Use a random cow character.',
            default: false
          },
          b: {
            type: 'boolean',
            description: 'Borg mode - use borg face.',
            default: false
          },
          d: {
            type: 'boolean',
            description: 'Dead mode - use dead face.',
            default: false
          },
          g: {
            type: 'boolean',
            description: 'Greedy mode - use greedy face.',
            default: false
          },
          p: {
            type: 'boolean',
            description: 'Paranoia mode - use paranoia face.',
            default: false
          },
          s: {
            type: 'boolean',
            description: 'Stoned mode - use stoned face.',
            default: false
          },
          t: {
            type: 'boolean',
            description: 'Tired mode - use tired face.',
            default: false
          },
          w: {
            type: 'boolean',
            description: 'Youthful mode - use youthful face.',
            default: false
          },
          y: {
            type: 'boolean',
            description: 'Wired mode - use wired face.',
            default: false
          }
        },
        required: ['message']
      },
    };
  • src/index.ts:80-86 (registration)
    Tool registration call on the MCP server, specifying name 'cowthink', title/description from tools.ts, and Zod-based input schema (simplified). The handler follows inline.
    mcp_server.registerTool("cowthink", {
        title: COWTHINK.title,
        description: COWTHINK.description,
        inputSchema: {
            message: z.string().describe('The message for the cow to think.'),
            character: z.string().optional().default('default').describe('The cow character to use.')
        },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool generates ASCII art but does not reveal any behavioral traits such as output format, error handling, or performance characteristics. This is a significant gap for a tool with no annotation coverage.

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?

The description is a single, efficient sentence that directly states the tool's purpose without any unnecessary words. It is front-loaded with the core action and resource, making it highly concise and well-structured for quick understanding.

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 the lack of annotations and output schema, the description is incomplete. It does not address behavioral aspects like output format or error handling, which are crucial for an AI agent to use the tool effectively. The description alone is insufficient for a tool with no structured data support.

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?

The description does not add meaning beyond what the input schema provides, as schema description coverage is 100%. The schema already documents both parameters ('cow' with enum values and 'message' with default), so the baseline score of 3 is appropriate since the schema handles parameter documentation adequately.

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 specific action ('Generate ASCII art') and resource ('a cow thinking something'), distinguishing it from sibling tools like 'cowsay' (which likely speaks) and 'list_cows' (which lists available cows). It precisely communicates the tool's function without being vague or tautological.

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?

The description provides no guidance on when to use this tool versus alternatives like 'cowsay' or 'list_cows'. It lacks any mention of prerequisites, exclusions, or contextual cues for selection, leaving the agent to infer usage based solely on the tool name and description.

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/mrseanchow/cowsay-mcp'

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