MCP abilities

Find Tag Usage

lh-block-and-shortcode-auditor/find-tag-usage Read-only Idempotent

Finds where a block or shortcode is used across the network, from each site's last content scan. Returns a per-site summary (whether the tag is registered on that site, its provider, uses and item count) and a paged list of the posts, templates and widgets using it, each with title, status, occurrences and edit and view URLs. Pass tag as the full block name (e.g. tribe/event-datetime) or the bare shortcode tag without brackets. Optionally limit to one site_id or one object_status. Requires install_plugins; main site only.

ParameterTypeRequiredDefaultDescription
tagstringYesBlock name or shortcode tag (no brackets). Exact match.
tag_typestringNoOmit to match both. One of: block, shortcode.
site_idintegerNoLimit to one site. Omit for the whole network.
object_statusstringNoLimit items to one post status, e.g. publish or draft.
per_pageintegerNo100Items per page, 1 to 500. Default 100.
pageintegerNo1Page of items, from 1. Default 1.

Get Site Report

lh-block-and-shortcode-auditor/get-site-report Read-only Idempotent

Returns one site's blocks and shortcodes, with whether each is registered, its provider and how often it is used. They come from its last registry capture and content scan: each tag with whether it is registered on that site, the plugin, theme or namespace that provides it, its total uses and the number of posts or widgets using it. Filter by tag_type, by registration (use unregistered to find content left behind by removed plugins), or by a search on tag or provider. Use find-tag-usage to list the items using a specific tag. Requires install_plugins; main site only.

ParameterTypeRequiredDefaultDescription
site_idintegerYesSite ID, as returned by list-sites.
tag_typestringNoOnly blocks or only shortcodes. Omit for both. One of: block, shortcode.
registrationstringNo"all"all (the default), registered, or unregistered to find tags no longer provided by any active plugin or theme. One of: all, registered, unregistered.
searchstringNoSubstring match on tag or provider.
orderbystringNo"usage_count"Sort field: total uses (the default), number of items using the tag, tag name or provider. One of: usage_count, object_count, tag, provider.
orderstringNo"desc"Sort direction. Default desc. One of: asc, desc.
per_pageintegerNo100Tags per page, 1 to 500. Default 100.
pageintegerNo1Page of tags, from 1. Default 1.

List Sites

lh-block-and-shortcode-auditor/list-sites Read-only Idempotent

Returns active network sites with their registered and unregistered block and shortcode counts, most unregistered uses first. Each site also gives its total unregistered uses, and when it last captured its registry and fully scanned its content. Sorted by unregistered uses, most first. Set only_unregistered to return just the sites with unregistered tags. Use get-site-report for one site's tags and find-tag-usage for where a tag is used. Requires install_plugins; main site only.

ParameterTypeRequiredDefaultDescription
only_unregisteredbooleanNofalseOnly return sites with at least one unregistered block or shortcode.
searchstringNoCase-insensitive substring match on site name or URL.
per_pageintegerNo100Sites per page, 1 to 1000. Default 100.
pageintegerNo1Page of sites, from 1. Default 1.

Rescan Site

lh-block-and-shortcode-auditor/rescan-site Idempotent

Asks one site to recapture its registered blocks and shortcodes and re-scan all of its content. The work runs in the background in that site's own context, triggered by a request to the site, so results are not immediate: poll get-site-report or list-sites and watch sweep_in_progress and sweep_completed_gmt. Only changes the auditor's own data, never site content. Requires install_plugins; main site only.

ParameterTypeRequiredDefaultDescription
site_idintegerYesSite ID, as returned by list-sites.
task_idintegerNoOptional. The lh-tasks task this call is working on. Pass with claim_token: the call is refused unless you hold that claim, and a successful call renews it.
claim_tokenstringNoOptional. The claim_token from claim-next-task for task_id. Required when task_id is given.