Skip to main content
Glama

kaomoji

Retrieve Japanese text emoticons for any emotion or keyword to add inline text expressions.

Instructions

Get a kaomoji (Japanese text emoticon) by emotion or keyword. Perfect for inline text expressions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoEmotion or keyword (e.g. "happy", "sad", "cat", "shrug"). Omit for random.
categoryNoFilter by category (e.g. "happy", "animals", "table-flip")

Implementation Reference

  • src/mcp.ts:132-160 (registration)
    Registration of the 'kaomoji' MCP tool with name, description, Zod input schema, and handler function.
    server.tool(
      'kaomoji',
      'Get a kaomoji (Japanese text emoticon) by emotion or keyword. Perfect for inline text expressions.',
      {
        query: z.string().optional().describe('Emotion or keyword (e.g. "happy", "sad", "cat", "shrug"). Omit for random.'),
        category: z.string().optional().describe('Filter by category (e.g. "happy", "animals", "table-flip")'),
      },
      async ({ query, category }) => {
        if (!query && !category) {
          const k = getRandomKaomoji();
          return { content: [{ type: 'text', text: `${k.text}  — ${k.name}` }] };
        }
    
        let results = query ? searchKaomoji(query) : [];
        if (category) {
          const byCategory = getKaomojiByCategory(category);
          results = results.length > 0
            ? results.filter((r) => r.category === category)
            : byCategory;
        }
    
        if (results.length === 0) {
          return { content: [{ type: 'text', text: `No kaomoji found. Categories: ${listKaomojiCategories().join(', ')}` }] };
        }
    
        const text = results.map((k) => `${k.text}  — ${k.name} [${k.category}]`).join('\n');
        return { content: [{ type: 'text', text }] };
      }
    );
  • Handler logic for the 'kaomoji' tool: returns random kaomoji if no args, searches by query, filters by category, and formats results.
    async ({ query, category }) => {
      if (!query && !category) {
        const k = getRandomKaomoji();
        return { content: [{ type: 'text', text: `${k.text}  — ${k.name}` }] };
      }
    
      let results = query ? searchKaomoji(query) : [];
      if (category) {
        const byCategory = getKaomojiByCategory(category);
        results = results.length > 0
          ? results.filter((r) => r.category === category)
          : byCategory;
      }
    
      if (results.length === 0) {
        return { content: [{ type: 'text', text: `No kaomoji found. Categories: ${listKaomojiCategories().join(', ')}` }] };
      }
    
      const text = results.map((k) => `${k.text}  — ${k.name} [${k.category}]`).join('\n');
      return { content: [{ type: 'text', text }] };
    }
  • Helper functions for kaomoji data: loading from JSON, searching, filtering by category, random selection, listing categories/entries, and converting to result format.
    export async function loadKaomoji(): Promise<void> {
      const raw = await fs.readFile(KAOMOJI_PATH, 'utf-8');
      const parsed: Omit<KaomojiEntry, 'type'>[] = JSON.parse(raw);
      entries = parsed.map((e) => ({ ...e, type: 'kaomoji' as const }));
    }
    
    export function searchKaomoji(query: string): KaomojiEntry[] {
      return matchQuery(entries, query);
    }
    
    export function getKaomojiById(id: string): KaomojiEntry | undefined {
      return findById(entries, id);
    }
    
    export function getKaomojiByCategory(category: string): KaomojiEntry[] {
      return filterByCategory(entries, category);
    }
    
    export function getRandomKaomoji(): KaomojiEntry {
      return pickRandom(entries);
    }
    
    export function listKaomojiCategories(): string[] {
      return uniqueCategories(entries);
    }
    
    export function listAllKaomoji(): KaomojiEntry[] {
      return entries;
    }
    
    export function toKaomojiResult(entry: KaomojiEntry): KaomojiResult {
      return {
        id: entry.id,
        type: 'kaomoji',
        name: entry.name,
        category: entry.category,
        tags: entry.tags,
        text: entry.text,
      };
    }
  • KaomojiEntry interface: defines the structure of a kaomoji entry with id, type, name, category, tags, and text fields.
    export interface KaomojiEntry {
      id: string;
      type: 'kaomoji';
      name: string;
      category: string;
      tags: string[];
      text: string;
    }
  • KaomojiResult interface: output shape for kaomoji results, identical to KaomojiEntry minus internal details.
    export interface KaomojiResult {
      id: string;
      type: 'kaomoji';
      name: string;
      category: string;
      tags: string[];
      text: string;
    }
Behavior3/5

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

No annotations provided, so description carries full burden. It does not disclose any behavioral traits beyond basic retrieval; e.g., no mention of random behavior when query omitted, though implied by schema.

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?

Two concise sentences, front-loaded with action. No redundant information.

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?

For a simple retrieval tool with no output schema, the description provides core purpose and a use case. Lacks mention of return format or error handling, but acceptable for this 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?

Schema already describes both parameters with 100% coverage. Description adds only 'inline text expressions' context, which is not about parameter semantics.

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?

Description clearly states it retrieves kaomoji by emotion or keyword. Sibling tools are different domains (animate, banner, etc.), so no confusion.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Mentions 'perfect for inline text expressions' as a general use case, but no explicit guidance on when to use this tool versus siblings or when to choose query vs. category.

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/rxolve/artscii'

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