dolibarr
24.0.0-beta
Main Page
Related Pages
Topics
Classes
Files
File List
File Members
dolibarr_dev
htdocs
ai
class
mcptool.class.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (C) 2026 Laurent Destailleur <eldy@users.sourceforge.net>
3
* Copyright (C) 2026 Nick Fragoulis
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 3 of the License, or
8
* (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY, without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17
*/
18
32
abstract
class
McpTool
33
{
35
protected
$db;
36
38
protected
$user;
39
41
protected
$conf;
42
50
public
function
__construct
($db, $user, $conf)
51
{
52
$this->db = $db;
53
$this->
user
= $user;
54
$this->
conf
= $conf;
55
}
56
65
abstract
public
function
getDefinitions
(): array;
66
78
abstract
public
function
execute
(
string
$toolName, array $args);
79
86
public
function
getCategories
(): array
87
{
88
return
[
'global'
];
// Default
89
}
90
105
public
function
isSystem
()
106
{
107
return
false
;
108
}
109
}
McpTool
Abstract base class for all MCP (Model Context Protocol) tools.
Definition
mcptool.class.php:33
McpTool\execute
execute(string $toolName, array $args)
Execute a specific tool.
McpTool\getDefinitions
getDefinitions()
Return the list of tools provided by this class.
McpTool\__construct
__construct($db, $user, $conf)
Constructor.
Definition
mcptool.class.php:50
McpTool\isSystem
isSystem()
Return true if this is a system/infrastructure tool that must always remain visible and executable re...
Definition
mcptool.class.php:105
McpTool\getCategories
getCategories()
Return categories this tool belongs to.
Definition
mcptool.class.php:86
conf
conf($dolibarr_main_document_root)
Load conf file (file must exists)
Definition
inc.php:426
user
$conf db user
Active Directory does not allow anonymous connections.
Definition
repair.php:134
Generated on Mon Jun 22 2026 21:04:33 for
dolibarr
by Doxygen 1.11.0