Skip to content

Plugin protocol expansions

Pavel Erokhin edited this page Nov 9, 2026 · 5 revisions

Part of the Plugin protocol: the tools and prompt lines other plugins add, and the tools the backend runs itself.

Expansions

Since backend 6.14 and plugin 6.12. Other plugins and mods add tools, items, recipes, and prompt lines to Allay through its expansion API, the Java library chat.allay:allay-expansion (the plugin's wiki page Expansions tells how to write one). The plugin sends what reaches the backend with each ask and askx:

"expansion_tools": [
  { "name": "x_mana_status", "description": "The asking player's mana…", "parameters": { "type": "object", "properties": {}, "required": [] }, "access": "read", "expansion": "mana" }
],
"expansions": [
  { "id": "mana", "name": "Mana", "version": "1.0.0", "prompt": "Mana adds spells cast with a wand…" }
]
  • name is x_<expansion>_<tool>: x_, then [a-z0-9_]{1,24}, _, and [a-z0-9_]{1,32}. description is 1–1000 characters, parameters a JSON Schema object, access read (reads the game), own (changes only the asker's own things), or operator. At most 32 tools and 16 expansions, and prompt at most 2000 characters. A bad entry is dropped, not the request.
  • The plugin sends only the tools this asker may use here: operator ones for operators, only read ones in askx, only those the expansion marks for public questions in a public ask, each behind the expansion's own permission, and none for the console or an automation agent. The backend checks access and mode again, and gives an agent (task) neither tools nor prompts.
  • The model gets the tools after Allay's own, so their fixed order keeps the provider's prompt cache. Each description starts with [Name, a plugin on this server], and the schema keeps only type, description, properties, required, items, enum, and the numeric bounds, four levels deep, with every field required and the optional ones nullable, as for Allay's own tools.
  • A call goes to the plugin as any client tool, tool_call with the tool's name, and its result comes back the same way. The plugin runs only a tool this run offered, checks the asker's rights again, and cuts a result at 8000 characters, the backend at 10 000.
  • The prompt gets a section “Plugins and mods that extend you”, after the base prompt and before “This conversation”: one line that frames what follows as the server's plugins' notes, under Allay's own rules, and then each expansion's prompt under “## Name's plugin prompt”.

Server tools (run by the backend)

Name Args Notes
search_web { "query": "…", "sites"?: [domain], "recency"?: "day" | "week" | "month" | "year" } Since 5.5, with the backend's PERPLEXITY_API_KEY and no server key: Perplexity's Search API, up to 5 results {title, url, date?, snippet}. Otherwise, and for BYOK: { "query" } through the search model, a summary with source URLs
exact_calculations { "expressions": ["ceil(1000 / 64)", "(-1024 / 8)", "3 hours to seconds"] } Up to 10 expressions, each ≤ 300 chars, evaluated with math.js at 64 significant digits (units and conversions work). Returns [{ expression, result }] or { expression, error } per line. Each expression gets 1 s
memories { "action"?: "add" | "find" | "delete", "text"?: "≤ 200", "here"?: bool, "x"?, "y"?, "z"?, "dimension"?, "query"?: "≤ 100", "near"?: bool, "limit"?: 1–50, "id"? } Since 6.9, replacing remember and forget. add saves a fact, or a place with here (from player.position) or x, z (and y, dimension): { saved: { id, text, x?, y?, z?, dimension?, world?, distance?, direction?, created_at } }. At most MEMORY_MAX (200) per player. find (default): { matched, total, memories: [...] }, newest first or nearest with near, all of them when no word of query matches. delete: { deleted: id }

All server tools report progress only through tool_status (kind server).

Next: Automation agents and memory

Clone this wiki locally