Coding standards
Security in ResourceSpace
Developer reference
Database
Mcp browse functions
Mcp report functions
Mcp management functions

mcp_management_tools()

Description

Declare bounded management and inspection reads. The catalogue is public, data access is checked on every call.

Parameters

ColumnTypeDefaultDescription
array { : ['offset'
$offset;
'items'
'total'
'record'
'query'
...$dates
['refs'
'metadata_fields'
...$page]
['refs']
['resources' > $rows['rows']]
['inspection' > ['metadata'
'storage']]]
'audit_resources' > ['Find visible assets missing every supplied metadata field
licence with
integrity recorded
previews missing
['missing_fields'
'resource_type'
'workflow_state'
[]
$rows
['condition' > ['inventory'
'no_licence'
'linked_licence'
'multiple_licence'
'expired_licence'
'no_consent'
'linked_consent'
'multiple_consent'
'withdrawn_consent'
'no_preview'
'no_download'
'integrity_failure']
'access' > ['open'
'restricted']
'date_basis' > ['last_active'
'modified']
'order_by' > ['ref'
'largest']]]
'get_processing_jobs' > ['Read recorded job states and scheduled dates. Administrators can inspect the queue. Other users see their own jobs.'
$page
[]]
'get_collection_searches' > ['Inspect stored search criteria for a collection you own or manage. Does not execute or refresh its searches.'
['collection'
['collection']
'get_brand_guidelines' > ['List Brand Guidelines pages and sections with links to the current guidance.'
'get_workflow_transitions' > ['Describe transitions the Workflow plugin would offer on this resource. Returns actions as data.'
['ref'
['ref']
'get_notifications' > ['Inspect your notification dates
and group
'get_search_statistics' > ['Installation administrator report of recorded keyword usage or keywords returning no results. Inclusive dates span at most four years.'
[...$dates
$dates
['metric' > ['uploads'
'no_results']]]
'get_plugin_fields' > ['Discover existing transcript
OCR
['resource_type'
['resource_type']
'get_metadata_completeness' > ['Compare completeness for up to ten specified fields over the same accessible search population. Percentages exclude inapplicable or hidden fields.'
['metadata_fields'
'workflow_state']
['metadata_fields']
'find_similar_resources' > ['Find visible images using stored CLIP image vectors. Near-duplicate uses the higher configured threshold. Results are a bounded candidate set. Named-person mode uses visible
face recorded
['similarity' > ['visual'
'near_duplicate'
'same_named_person']]]
'get_resource_representations' > ['List authorised stored image renditions for a page and any downloadable audio or video preview
OAuth with
'page']
'get_collection_history' > ['Read collection-level events subject to collection log access. Resource-specific events are available through get_resource_log.'
'get_current_user' > ['Read your account ID
name display
'permissions'
'search_users' > ['List manageable accounts. Dates select last activity default
or creation
account select
filter or
['account'
'group'
['status' > ['active'
'approved'
'disabled']
'created'
'expires']]]
'get_user_statistics' > ['Count manageable accounts by group or approval status. Dates select last activity default
['group'
['group_by' > ['resource_type'
'status']
'status' > ['pending'
'get_user_groups' > ['Administrators can inspect group names
IDs parent
'get_workflow_states' > ['List visible workflow state IDs and their localised labels.'
'get_resource_requests' > ['List managed resource requests visible on the request management page. Dates apply to request creation.'
['record'
'declined']]]
'list_reports' > ['List visible native report definitions by ID and name. Use dedicated statistics tools for numeric results.'
'get_activity_statistics' > ['Administrator installation-wide event totals from retained daily statistics. Supply inclusive dates spanning at most four years.'
'downloads'
'views'
'searches'
'sessions'
'active_users'
'logins']
'group_by' > ['day'
'week'
'month'
'year'
'account']]]
'get_storage_statistics' > ['Administrator inventory of recorded original and total disk usage in bytes
by grouped
'file_extension']]]
'get_licences' > ['Read Licence Manager records and conditions. Supply ref for associations to an accessible asset
use or
$scope
'current'
'undated']
'result' > ['records'
'summary']
'association' > ['all'
'unlinked']]]
'get_consent' > ['Read Consent Manager records
usage recorded
'expired'
'get_external_shares' > ['Inspect existing outgoing shares. Supply an accessible resource or collection to inspect your own shares. Administrators can query across shares. Dates filter expiry.'
'collection'
'expired']]]
'get_resource_annotations' > ['Read visible annotation rectangles for a resource. Geometry is expressed as fractions of preview dimensions. Optional page is one-based.'
'page'
* ]; } /**
$params array
$args array
$context array
$limit

Return

array Tool declarations in the format used by mcp_extended_tools().

Location

include/mcp_management_functions.php lines 7 to 66

Definition

 
function mcp_management_tools(): array
{
    
$page = ['offset', 'limit'];
    
$dates = ['date_from', 'date_to'];
    
$rows = ['rows' => ['type' => 'array', 'items' => ['type' => 'object']], 'total' => ['type' => 'integer']];
    
$scope = ['ref', 'record', 'query', ...$dates, ...$page];
    return [
        
'get_resources' => ['Inspect up to ten resource references. Each item has independent access checks. Select metadata_fields or limit per-resource metadata and alternatives. Administrators can check original file presence with inspection=storage.',
            [
'refs', 'metadata_fields', ...$page], ['refs'], ['resources' => $rows['rows']], ['inspection' => ['metadata', 'storage']]],
        
'audit_resources' => ['Find visible assets missing every supplied metadata field, with licence or consent gaps, recorded integrity failures, missing previews or no retained downloads. Resource dates refer to creation or modification. Order by largest original file if needed.',
            [
'missing_fields', 'record', 'query', 'resource_type', 'workflow_state', ...$dates, ...$page], [], $rows,
            [
'condition' => ['inventory', 'no_licence', 'linked_licence', 'multiple_licence', 'expired_licence', 'no_consent', 'linked_consent', 'multiple_consent', 'withdrawn_consent', 'no_preview', 'no_download', 'integrity_failure'],
            
'access' => ['open', 'restricted'], 'date_basis' => ['created', 'modified'], 'order_by' => ['ref', 'largest']]],
        
'get_processing_jobs' => ['Read recorded job states and scheduled dates. Administrators can inspect the queue. Other users see their own jobs.',
            
$page, [], $rows, []],
        
'get_collection_searches' => ['Inspect stored search criteria for a collection you own or manage. Does not execute or refresh its searches.',
            [
'collection', ...$page], ['collection'], $rows, []],
        
'get_brand_guidelines' => ['List Brand Guidelines pages and sections with links to the current guidance.', $page, [], $rows, []],
        
'get_workflow_transitions' => ['Describe transitions the Workflow plugin would offer on this resource. Returns actions as data.',
            [
'ref', ...$page], ['ref'], $rows, []],
        
'get_notifications' => ['Inspect your notification dates, IDs and read status. Message bodies and links may contain private credentials and are omitted.',
            
$page, [], $rows, []],
        
'get_search_statistics' => ['Installation administrator report of recorded keyword usage or keywords returning no results. Inclusive dates span at most four years.',
            [...
$dates, ...$page], $dates, $rows, ['metric' => ['keyword_usage', 'no_results']]],
        
'get_plugin_fields' => ['Discover existing transcript, OCR, AI-tag and other plugin metadata for an accessible resource type. Use the returned field IDs with search_resources or get_resource.',
            [
'resource_type', ...$page], ['resource_type'], $rows, []],
        
'get_metadata_completeness' => ['Compare completeness for up to ten specified fields over the same accessible search population. Percentages exclude inapplicable or hidden fields.',
            [
'metadata_fields', 'query', 'resource_type', 'workflow_state'], ['metadata_fields'], $rows, []],
        
'find_similar_resources' => ['Find visible images using stored CLIP image vectors. Near-duplicate uses the higher configured threshold. Results are a bounded candidate set. Named-person mode uses visible, recorded face tags.',
            [
'ref', ...$page], ['ref'], $rows, ['similarity' => ['visual', 'near_duplicate', 'same_named_person']]],
        
'get_resource_representations' => ['List authorised stored image renditions for a page and any downloadable audio or video preview, with OAuth URLs. Use get_resource for named alternative files.',
            [
'ref', 'page'], ['ref'], $rows, []],
        
'get_collection_history' => ['Read collection-level events subject to collection log access. Resource-specific events are available through get_resource_log.',
            [
'collection', ...$dates, ...$page], ['collection'], $rows, []],
        
'get_current_user' => ['Read your account ID, display name, group and current effective permission codes.', [], [],
            [
'ref' => ['type' => 'integer'], 'permissions' => ['type' => 'array', 'items' => ['type' => 'string']]], []],
        
'search_users' => ['List manageable accounts. Dates select last activity (default), creation or expiry. Search names, select account or group IDs, or filter approval status.',
            [
'account', 'group', 'query', ...$dates, ...$page], [], $rows, ['status' => ['pending', 'approved', 'disabled'], 'date_basis' => ['last_active', 'created', 'expires']]],
        
'get_user_statistics' => ['Count manageable accounts by group or approval status. Dates select last activity (default), creation or expiry.',
            [
'group', ...$dates, ...$page], [], $rows, ['group_by' => ['group', 'status'], 'status' => ['pending', 'approved', 'disabled'], 'date_basis' => ['last_active', 'created', 'expires']]],
        
'get_user_groups' => ['Administrators can inspect group names, parent IDs and configured permission codes.', ['group', ...$page], [], $rows, []],
        
'get_workflow_states' => ['List visible workflow state IDs and their localised labels.', $page, [], $rows, []],
        
'get_resource_requests' => ['List managed resource requests visible on the request management page. Dates apply to request creation.',
            [
'record', ...$dates, ...$page], [], $rows, ['status' => ['pending', 'approved', 'declined']]],
        
'list_reports' => ['List visible native report definitions by ID and name. Use dedicated statistics tools for numeric results.', $page, [], $rows, []],
        
'get_activity_statistics' => ['Administrator installation-wide event totals from retained daily statistics. Supply inclusive dates spanning at most four years.',
            [...
$dates, 'group', ...$page], $dates, $rows, ['metric' => ['uploads', 'downloads', 'views', 'searches', 'sessions', 'active_users', 'logins'],
            
'group_by' => ['day', 'week', 'month', 'year', 'group', 'account']]],
        
'get_storage_statistics' => ['Administrator inventory of recorded original and total disk usage in bytes, grouped by type or extension. Missing measurements are counted separately.',
            [
'resource_type', ...$page], [], $rows, ['group_by' => ['resource_type', 'file_extension']]],
        
'get_licences' => ['Read Licence Manager records and conditions. Supply ref for associations to an accessible asset, or use catalogue permissions. Dates filter expiry. Choose summary for counts by recorded status.',
            
$scope, [], $rows, ['status' => ['expired', 'current', 'undated'], 'result' => ['records', 'summary'], 'association' => ['all', 'unlinked']]],
        
'get_consent' => ['Read Consent Manager records, recorded usage and withdrawal status. Supply ref for resource associations. Dates filter expiry. Names require catalogue access. Contact details and signatures are excluded.',
            
$scope, [], $rows, ['status' => ['withdrawn', 'expired', 'current', 'undated'], 'result' => ['records', 'summary'], 'association' => ['all', 'unlinked']]],
        
'get_external_shares' => ['Inspect existing outgoing shares. Supply an accessible resource or collection to inspect your own shares. Administrators can query across shares. Dates filter expiry.',
            [
'ref', 'collection', ...$dates, ...$page], [], $rows, ['status' => ['active', 'expired']]],
        
'get_resource_annotations' => ['Read visible annotation rectangles for a resource. Geometry is expressed as fractions of preview dimensions. Optional page is one-based.',
            [
'ref', 'page', ...$page], ['ref'], $rows, []],
    ];
}

This article was last updated 4th December 2026 11:35 Europe/London time based on the source file dated 4th December 2026 09:40 Europe/London time.