Admin Tools

A tool is a single page in the admin's Tools area (/textstem/tools/{name}) for diagnostics or one-off jobs that don't need a full admin section. The package ships many, including Queue Monitor, Schedule Monitor, Log Viewer, Cache Manager, Environment, Deployment Checks, Email Tester, Security Audit, Shortcodes, Prompt Manager and OpenAI Usage.

Only super-admins can open tools. ToolsController checks isSuperAdmin() on every tool route. There is no per-tool permission, so to give other people an admin screen, build a module instead.

These tools are unrelated to MCP tools, the functions the MCP server offers AI assistants.

Creating a tool

php artisan textstem:make:tool SiteReport

This creates:

  • app/Tools/SiteReport.php
  • resources/views/wrangler/tools/site-report/default.blade.php, wrapped in <x-textstem::app-layout> with the standard Tools header
<?php

namespace App\Tools;

use Illuminate\Http\Request;
use Medialight\Textstem\Domain\Tools\BaseTool;

class SiteReport extends BaseTool
{
    public static string $description = '';

    public function render(Request $request)
    {
        $data = [];

        return view('wrangler.tools.site-report.default', $data);
    }
}

Fill in $description (shown on the Tools index) and the data your view needs. render() can return anything a controller can: a view, a redirect or a JSON response. Tool routes accept GET and POST, so a tool can handle its own forms.

Earlier versions of this generator wrote two broken class files instead of one working one (an unsubstituted {{ class }} token, a stray $ in the view reference, and a namespace/path mismatch on a duplicate copy in app/Services/) — fixed in src/Console/Commands/MakeTextstemTool.php and stubs/tool.stub. If you're on an older version of this package, see the fix commit for the corrected stub, or apply the pattern above by hand.

How tools are found

Tools aren't registered. The Tools index lists the classes in the package's src/Tools/ and in your app/Tools/. When a tool is opened, its class is looked up as App\Tools\{Name}, then App\Wrangler\Tools\{Name}, then Medialight\Textstem\Tools\{Name}, so a host-app class replaces a package tool of the same name. The Shortcodes tool is extended this way in Template Commands.

An icon

Add resources/views/wrangler/tools/{name}/icon.svg and it is shown on the Tools index, sized like the built-in icons.

Sharing tools

php artisan textstem:export-tool SiteReport packs a tool into a ZIP, which another site installs at Tools → Install (/textstem/tools/install).

esc