|
dolibarr 25.0.0-alpha
|
Class ToolEmailCleaner. More...


Public Member Functions | |
| getDefinitions () | |
| Returns tool definitions. | |
| getCategories () | |
| Return categories this tool belongs to. | |
| execute (string $name, array $args) | |
| Execute tool. | |
Public Member Functions inherited from McpTool | |
| __construct ($db, $user, $conf) | |
| Constructor. | |
| isSystem () | |
| Return true if this is a system/infrastructure tool that must always remain visible and executable regardless of the admin allow-list. | |
| getRequiredRights (string $toolName) | |
| Rights the caller must hold to run a tool of this class. | |
| writeConfirmationPreview (string $toolName, array $args) | |
| Preview of what a call would write, or NO_WRITE for a read tool. | |
Private Member Functions | |
| canReadEmailData () | |
| Check read permission for technical email data. | |
| listEmailCleanerRuns (array $args) | |
| List cleaner runs. | |
| getEmailCleanerRun (array $args) | |
| Get one cleaner run. | |
| getEmailThreadContext (array $args) | |
| Get only the technical email thread context from a cleaner run. | |
| getEmailHandoffPayload (array $args) | |
| Get handoff payload. | |
| isTableAvailable (string $tableWithoutPrefix) | |
| Check if a table is available. | |
| decodeJsonOrRaw (string $raw) | |
| Decode json string, fallback to raw. | |
| sanitizeLimit ($raw) | |
| Sanitize limit. | |
| sanitizeConfidenceOrNull ($raw) | |
| Sanitize confidence value or return null. | |
| appendComplianceMetadata (array $result) | |
| Append compliance disclosure to MCP responses. | |
Additional Inherited Members | |
Public Attributes inherited from McpTool | |
| const | RIGHTS_UNDECLARED = 'undeclared' |
| Default of getRequiredRights(): the class never declared anything, deny. | |
| const | NO_WRITE = '' |
| Returned by writeConfirmationPreview() when the tool writes nothing. | |
Class ToolEmailCleaner.
Definition at line 28 of file email_cleaner.class.php.
|
private |
Append compliance disclosure to MCP responses.
| array<string,mixed> | $result Tool output |
Definition at line 520 of file email_cleaner.class.php.
Referenced by execute().
|
private |
Check read permission for technical email data.
Definition at line 177 of file email_cleaner.class.php.
References conf(), getDolGlobalInt(), isModEnabled(), and user.
Referenced by execute().
|
private |
Decode json string, fallback to raw.
| string | $raw | Raw value from database storage |
Definition at line 462 of file email_cleaner.class.php.
Referenced by getEmailCleanerRun(), and listEmailCleanerRuns().
| ToolEmailCleaner::execute | ( | string | $name, |
| array | $args ) |
Execute tool.
| string | $name | Tool function name |
| array<string,mixed> | $args Tool arguments |
Reimplemented from McpTool.
Definition at line 140 of file email_cleaner.class.php.
References appendComplianceMetadata(), canReadEmailData(), getEmailCleanerRun(), getEmailHandoffPayload(), getEmailThreadContext(), and listEmailCleanerRuns().
| ToolEmailCleaner::getCategories | ( | ) |
Return categories this tool belongs to.
Reimplemented from McpTool.
Definition at line 128 of file email_cleaner.class.php.
| ToolEmailCleaner::getDefinitions | ( | ) |
Returns tool definitions.
Reimplemented from McpTool.
Definition at line 43 of file email_cleaner.class.php.
References getDolGlobalInt(), and isModEnabled().
|
private |
Get one cleaner run.
| array<string,mixed> | $args Selector arguments |
Definition at line 298 of file email_cleaner.class.php.
References conf(), decodeJsonOrRaw(), and isTableAvailable().
Referenced by execute(), getEmailHandoffPayload(), and getEmailThreadContext().
|
private |
Get handoff payload.
| array<string,mixed> | $args Handoff selector arguments |
Definition at line 411 of file email_cleaner.class.php.
References getEmailCleanerRun().
Referenced by execute().
|
private |
Get only the technical email thread context from a cleaner run.
| array<string,mixed> | $args Selector arguments |
Definition at line 375 of file email_cleaner.class.php.
References getEmailCleanerRun().
Referenced by execute().
|
private |
Check if a table is available.
| string | $tableWithoutPrefix | SQL table name without DB prefix |
Definition at line 443 of file email_cleaner.class.php.
Referenced by getEmailCleanerRun(), and listEmailCleanerRuns().
|
private |
List cleaner runs.
| array<string,mixed> | $args Filter and pagination arguments |
Definition at line 206 of file email_cleaner.class.php.
References conf(), decodeJsonOrRaw(), isTableAvailable(), sanitizeConfidenceOrNull(), and sanitizeLimit().
Referenced by execute().
|
private |
Sanitize confidence value or return null.
| mixed | $raw | User-provided confidence value |
Definition at line 499 of file email_cleaner.class.php.
Referenced by listEmailCleanerRuns().
|
private |
Sanitize limit.
| mixed | $raw | User-provided limit |
Definition at line 481 of file email_cleaner.class.php.
Referenced by listEmailCleanerRuns().