Skip to main content
Glama
nictuku

Python MCP Server Template

by nictuku

get_joke

Retrieve a random joke from the Python MCP Server Template to add humor to applications or conversations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_joke' tool. It is decorated with @mcp.tool() for registration and fetches a random joke from an API, returning 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"]
  • mcp_server.py:11-11 (registration)
    The @mcp.tool() decorator registers the get_joke function as a tool in the FastMCP server.
    @mcp.tool()

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

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