Skip to main content
Glama
nictuku

Python MCP Server Template

by nictuku

get_joke

Generate a random joke using the Python MCP Server Template. This tool is designed to integrate humor into applications, enhancing user experience with a quick and simple API call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_joke' tool, registered via @mcp.tool() decorator. It fetches a random joke from the API and returns the setup followed by the punchline.
    @mcp.tool() async def get_joke() -> str: response = httpx.get("https://official-joke-api.appspot.com/random_joke") joke_data = response.json() return joke_data["setup"] + "\n" + joke_data["punchline"]

Other Tools

Related 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/nictuku/py-mcp-server-template'

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