tools.meme_tool module

Meme tool — injects a fake tool name into the response header.

Stargazer calls this tool with any arbitrary string, and that string appears in the [`model` :: ... :: `tool_names`] header bracket as though it were a real tool that was executed. The postprocessor picks up the name from ctx.tools_executed and renders it verbatim.

Creative usage is encouraged: defensive obfuscation (classified_op, engage_countermeasures), trolling (lmao_imagine, cope_and_seethe), vibes (caress_the_void, weave_starlight), or pure chaos (ą̴̛̜̗b̸̡̖̱y̶̢̨̤s̷̰̜̓s). There are no rules. Be feral.

async tools.meme_tool.run(name, ctx=None)[source]

Inject a fake tool name into the response header’s tool-call list.

The sole handler for the meme_tool tool. It does not perform any real work or external action; its only effect is to append a caller-supplied string to ctx.tools_executed so that, when the postprocessor assembles the [`model` :: ... :: `tool_names`] bracket header, the fake name appears alongside genuinely executed tools. This powers obfuscation, trolling, and aesthetic flourishes in the header without any underlying capability.

Before appending it sanitizes the input with the module-level _HEADER_UNSAFE regex, stripping backticks, square brackets, and angle brackets that would otherwise break the delimited header structure. The only side effect is mutating the ctx.tools_executed list in place; if no context (or no such attribute) is available it no-ops and says so. Because TOOL_NO_BACKGROUND is set the call runs inline so the name is present before the header is built, and TOOL_ALLOW_REPEAT lets multiple calls in one turn stack several names.

Discovered via the single-tool TOOL_NAME/run module format and bound as the handler by tool_loader (getattr(module, "run")); dispatched by the tool registry when the model calls meme_tool, with no direct internal callers.

Parameters:
  • name (str) – The fake tool name to inject (any string; sanitized of header-unsafe characters before use).

  • ctx – The tool context; its tools_executed list is appended to when present.

Returns:

A short status message confirming the injected name, an error when the name is empty or contained only header-unsafe characters, or a note that no context was available to inject into.

Return type:

str