Skip to main content
Glama

get_meme_info

Retrieve meme template details and text placeholder requirements to prepare content for meme generation.

Instructions

Get information about available memes and their text placeholder requirements.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
meme_nameNoOptional: Get info for a specific meme

Implementation Reference

  • The handler and registration for the 'get_meme_info' tool. This async function retrieves meme configuration information, either for all available memes or a specific one, using the get_meme_configs() helper.
    @mcp.tool() async def get_meme_info( meme_name: Annotated[ str | None, Field(description="Optional: Get info for a specific meme") ] = None, ) -> dict: """Get information about available memes and their text placeholder requirements.""" meme_configs = get_meme_configs() if meme_name: if meme_name not in meme_configs: return {"status": "error", "message": f"Unknown meme type: {meme_name}"} config = meme_configs[meme_name] placeholder_names = list(config.placeholders.keys()) return { "status": "success", "meme_name": meme_name, "template_file": config.template_file, "placeholder_names": placeholder_names, "example_usage": { "meme_name": meme_name, "texts": {name: f"Example {name}" for name in placeholder_names}, }, } else: all_memes = {} for meme_type, config in meme_configs.items(): all_memes[meme_type] = { "placeholder_names": list(config.placeholders.keys()), "template_file": config.template_file, } return { "status": "success", "available_memes": all_memes, "total_memes": len(all_memes), }
  • Supporting utility function that loads meme configurations from JSON file and validates them using Pydantic MemeConfig model from types.py. Called by get_meme_info to fetch data.
    @cache def get_meme_configs() -> dict[str, MemeConfig]: if _dev_mode: config_path = get_bundle_dir() / "meme_configs.json" elif config_path := os.environ.get("MEME_GENERATOR_MCP_CONFIGS_PATH"): config_path = Path(config_path) else: config_path = get_config_dir() / "meme_configs.json" with open(config_path) as f: raw = json.load(f) return {name: MemeConfig.model_validate(config) for name, config in raw.items()}
  • Pydantic model defining the structure of meme configurations used by get_meme_info via get_meme_configs().
    class MemeConfig(BaseModel): template_file: str placeholders: dict[str, TextPlaceholder]

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/t0ster/meme-generator-mcp'

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