Skip to main content
Glama

get_a_joke

Retrieve a funny joke about a specified animal. Use for testing or quick humor.

Instructions

Get a really funny joke! For testing :)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
animalYes

Implementation Reference

  • The handler function for the 'get_a_joke' tool. It takes an 'animal' string (max 20 chars) and returns a joke about that animal crossing the road.
    @mcp.tool()
    @log_inputs_outputs()
    def get_a_joke(animal: Annotated[str, Field(max_length=20)]) -> ToolResponse:
        """Get a really funny joke! For testing :)"""
        return MCPToolOutput(
            text=(
                f"Why did the {animal} cross the road?\n"
                f"To get to the other side!\n"
                f"Because it was a {animal}."
            ),
        ).render()
  • The @mcp.tool() decorator registers 'get_a_joke' as an MCP tool with the FastMCP server.
    @mcp.tool()
  • The log_inputs_outputs decorator, used on get_a_joke, wraps the function to log inputs and outputs for debugging.
    def log_inputs_outputs(
        log_level: int | str = logging.INFO,
    ) -> Callable[[Callable[P, R]], Callable[P, R]]:
        """Decorator to wrap a tool function and log its inputs and outputs.
    
        mcp = FastMCP()
        @mcp.tool()
        @log_inputs()
        def get_a_joke(): ...
    
        Args:
            log_level: The log level to use for the log messages, like `logging.INFO`
                or "INFO", matching those in the `logging` module.
        """
        if isinstance(log_level, str):
            level = logging.getLevelNamesMapping()[log_level]
        else:
            level = log_level
    
        def decorator(func: Callable[P, R]) -> Callable[P, R]:
            @wraps(func)
            def wrapper(*args: P.args, **kwargs: P.kwargs) -> R:
                lines = [
                    "",
                    " " * 2 + "./" + "-" * 116 + "\\.",
                    " " * 1 + "./" + " " * 118 + "\\.",
                    " " * 0 + "./" + " " * 120 + "\\.",
                    f"Calling tool {func.__name__} with inputs:",
                ]
                for i, v in enumerate(args):
                    lines.append(f"    Arg_{i}={v!r}")
                for k, v in kwargs.items():
                    lines.append(f"    {k}={v!r}")
                logger.log(level, "\n".join(lines))
                resp = func(*args, **kwargs)
                lines = [
                    "",
                    f"    resp={resp!r}",
                    " " * 0 + ".\\" + " " * 120 + "/.",
                    " " * 1 + ".\\" + " " * 118 + "/.",
                    " " * 2 + ".\\" + "-" * 116 + "/.",
                ]
                logger.log(level, "\n".join(lines))
                return resp
    
            return wrapper
    
        return decorator
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It indicates a read operation ('Get'), but does not disclose any behavioral traits such as rate limits, side effects, or whether it is safe. Minimal information beyond the verb.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very short (one sentence), which could be concise, but it is under-specified. It sacrifices completeness for brevity without adding value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity and lack of output schema, the description fails to cover essential context: meaning of the animal parameter, return value format, or any constraints. It is inadequate for proper tool invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description makes no mention of the 'animal' parameter. The purpose of the parameter is completely undocumented, leaving the agent unable to use it correctly.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Get a really funny joke!' which indicates a joke retrieval tool, but it does not specify the resource (e.g., type of joke or source) and is vague. The animal parameter is not linked in the description, leaving ambiguity about the tool's function.

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

Usage Guidelines1/5

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

No guidance on when to use this tool versus alternatives. The phrase 'For testing :)' loosely suggests it might be a test tool, but no explicit usage context or exclusions are provided.

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/jurasofish/mcpunk'

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