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


Public Member Functions | |
| __construct ($db, $user) | |
| Constructor. | |
| getDefinitions () | |
| Returns an array of tool definitions, including name, description, and input schema. | |
| getRequiredRights (string $toolName) | |
| Third-party reads and writes. | |
| writeConfirmationPreview (string $toolName, array $args) | |
| Preview of the third-party record this call would write. | |
| getCategories () | |
| Return categories this tool belongs to. | |
| execute (string $name, array $args) | |
| Executes the requested tool function based on its name. | |
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. | |
Private Member Functions | |
| search (array $args, int $count=0) | |
| Search for third parties based on provided criteria. | |
| getDetails (array $args) | |
| Fetch details for a specific third party (Societe). | |
| listContacts (array $args) | |
| List all contacts for a given thirdparty. | |
| addContact (array $args) | |
| Add a contact linked to a thirdparty. | |
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 ToolThirdParty.
Provides various tools related to Dolibarr categories.
Definition at line 35 of file thirdparty.class.php.
| ToolThirdParty::__construct | ( | $db, | |
| $user ) |
|
private |
Add a contact linked to a thirdparty.
| array{thirdparty_identifier:int|string,firstname:string,lastname:string,email?:string,phone?:string} | $args Arguments array (identifier, firstname, lastname required). |
Definition at line 698 of file thirdparty.class.php.
References user.
Referenced by execute().
| ToolThirdParty::execute | ( | string | $name, |
| array | $args ) |
Executes the requested tool function based on its name.
| string | $name | The name of the tool to execute. |
| array<string,mixed> | $args The arguments for the tool (key-value pairs). |
Reimplemented from McpTool.
Definition at line 235 of file thirdparty.class.php.
References addContact(), getDetails(), listContacts(), and search().
| ToolThirdParty::getCategories | ( | ) |
Return categories this tool belongs to.
Used by the intent parser to filter available tools.
Reimplemented from McpTool.
Definition at line 223 of file thirdparty.class.php.
| ToolThirdParty::getDefinitions | ( | ) |
Returns an array of tool definitions, including name, description, and input schema.
Reimplemented from McpTool.
Definition at line 55 of file thirdparty.class.php.
|
private |
Fetch details for a specific third party (Societe).
| array{id | int|string} $args Arguments array containing the thirdparty ID. |
Definition at line 383 of file thirdparty.class.php.
References user.
Referenced by execute().
| ToolThirdParty::getRequiredRights | ( | string | $toolName | ) |
Third-party reads and writes.
| string | $toolName | Tool being executed. |
Reimplemented from McpTool.
Definition at line 177 of file thirdparty.class.php.
References McpTool\RIGHTS_UNDECLARED.
|
private |
List all contacts for a given thirdparty.
| array{id | int|string} $args Arguments array containing the thirdparty ID. |
Definition at line 618 of file thirdparty.class.php.
References dol_syslog(), getEntity(), and user.
Referenced by execute().
|
private |
Search for third parties based on provided criteria.
| array{query:string|int,type?:string,country_code?:string,limit?:int|string} | $args Array of arguments:
| |
| int | $count | If set to 1, returns only the count of results. |
Definition at line 268 of file thirdparty.class.php.
References dol_syslog(), getEntity(), and user.
Referenced by execute().
| ToolThirdParty::writeConfirmationPreview | ( | string | $toolName, |
| array | $args ) |
Preview of the third-party record this call would write.
| string | $toolName | Tool that would run. |
| array<string,mixed> | $args Arguments it would run with. |
Reimplemented from McpTool.
Definition at line 199 of file thirdparty.class.php.
References McpTool\NO_WRITE.