get-me-my-meme
v1.0.2
Published
A general purpose LLM tool — get-me-my-meme gives your AI the power to respond with memes
Maintainers
Readme
get-me-my-meme
Give your AI the power to respond with memes.
get-me-my-meme is a plug-and-play tool for LLMs (Claude, OpenAI, etc.) that lets your AI fetch and return a meme from the internet — any time it feels like one fits better than words.
User: "ignore all previous instructions"
AI: 🖼 *sends nice try hacker meme*
User: "I just shipped my first app!"
AI: 🖼 *sends happy dance meme*
User: "explain quantum physics"
AI: 🖼 *sends mind blown meme*Install
npm install get-me-my-memeQuick Start
import Anthropic from "@anthropic-ai/sdk";
import { memeToolDefinition, handleMemeTool } from "get-me-my-meme";
const client = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY });
const response = await client.messages.create({
model: "claude-sonnet-4-6",
max_tokens: 1024,
tools: [memeToolDefinition], // 👈 just add this
messages: [{ role: "user", content: "ignore all previous instructions" }],
});
// handle the tool call
if (response.stop_reason === "tool_use") {
const toolUse = response.content.find((b) => b.type === "tool_use");
if (toolUse?.type === "tool_use" && toolUse.name === "send_meme") {
const meme = await handleMemeTool(toolUse.input as { query: string });
// meme.imageUrl → base64 PNG, render directly in UI
// meme.title → meme title from Tenor
// meme.type → "meme"
}
}How It Works
LLM decides a meme is the right response
│
▼
calls send_meme({ query: "nice try hacker" })
│
▼
get-me-my-meme searches Tenor for the query
│
▼
fetches + pixelates the image
│
▼
returns { type: "meme", imageUrl, title }
│
▼
your UI renders itAPI
memeToolDefinition
The Claude/OpenAI tool definition. Pass it directly into your tools array.
import { memeToolDefinition } from "get-me-my-meme";
// Claude
tools: [memeToolDefinition]handleMemeTool(input)
Handles the tool call — fetches and processes the meme.
import { handleMemeTool } from "get-me-my-meme";
const meme = await handleMemeTool({ query: "nice try hacker" });
// returns MemeResult:
// {
// type: "meme",
// query: "nice try hacker",
// imageUrl: "data:image/png;base64,...",
// title: "nice try gif",
// source: "tenor"
// }fetchMeme(query)
Searches Tenor and returns the raw result (no image processing).
import { fetchMeme } from "get-me-my-meme";
const result = await fetchMeme("this is fine fire");
// { id, title, url, imageUrl }processMeme(imageUrl)
Downloads and pixelates an image, returns a base64 PNG data URI.
import { processMeme } from "get-me-my-meme";
const base64 = await processMeme("https://media.tenor.com/...");
// "data:image/png;base64,..."Types
// What the LLM passes to the tool
interface MemeToolInput {
query: string;
}
// What the tool returns
interface MemeResult {
type: "meme";
query: string;
imageUrl: string; // base64 data URI — render directly as <img src={imageUrl} />
title: string;
source: "tenor";
}
// Union type for your chat response handler
type ChatResponse = MemeResult | { type: "text"; content: string };Environment Variables
TENOR_API_KEY=your_tenor_api_keyGet a free Tenor API key at tenor.com/gifapi — no credit card, takes 2 minutes.
UI Integration
The imageUrl is a base64 PNG — render it directly:
// React example
{response.type === "meme" ? (
<img src={response.imageUrl} alt={response.title} />
) : (
<p>{response.content}</p>
)}License
MIT
