Skip to content

Commit 6f1dc4a

Browse files
committed
updated
1 parent b2d68f9 commit 6f1dc4a

12 files changed

+429
-82
lines changed

docs/api/apiaccess/tool/configureToolBox.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ cbparameters:
88
typeName: string
99
description: The name of the toolbox to configure
1010
- name: config
11-
typeName: any
12-
description: Configuration object for the toolbox
11+
typeName: object
12+
description: Configuration object containing toolbox-specific settings
1313
returns:
1414
signatureTypeName: Promise
15-
description: A promise that resolves when configuration is complete
15+
description: A promise that resolves with configuration result status
1616
typeArgs:
17-
- type: any
17+
- type: object
1818
data:
1919
name: configureToolBox
2020
category: tool
@@ -23,10 +23,14 @@ data:
2323
<CBBaseInfo/>
2424
<CBParameters/>
2525

26-
### Example
26+
### Simple Example
2727
```js
28-
await codeboltMCP.configureToolBox("analyticsTools", {
29-
apiKey: "12345",
30-
logging: true
28+
// Basic SQLite toolbox configuration
29+
const result = await codebolt.tools.configureToolBox('sqlite', {
30+
database_path: './my-database.db',
31+
read_only: true
3132
});
32-
console.log("Toolbox configured successfully");
33+
34+
console.log('Configuration successful:', result?.success);
35+
```
36+

docs/api/apiaccess/tool/executeTool.md

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ cbparameters:
1212
description: The name of the tool to execute
1313
- name: params
1414
typeName: object
15-
description: Parameters to pass to the tool execution
15+
description: Parameters to pass to the tool execution (must match tool's input schema)
1616
returns:
1717
signatureTypeName: Promise
1818
description: A promise that resolves with the tool execution result
1919
typeArgs:
20-
- type: any
20+
- type: object
2121
data:
2222
name: executeTool
2323
category: tool
@@ -26,11 +26,34 @@ data:
2626
<CBBaseInfo/>
2727
<CBParameters/>
2828

29-
### Example
29+
### Simple Example
3030
```js
31-
const result = await codeboltMCP.executeTool(
32-
"myToolBox",
33-
"dataProcessor",
34-
{ inputData: "test" }
35-
);
36-
console.log("Tool execution result:", result);
31+
// Read a file using filesystem toolbox
32+
const fsResult = await codebolt.tools.executeTool('filesystem', 'read_file', {
33+
path: './index.js'
34+
});
35+
36+
console.log('✅ Tool execution result:', JSON.stringify(fsResult, null, 2));
37+
```
38+
39+
```js
40+
// Different tools require different parameters
41+
42+
// Filesystem tools
43+
await codebolt.tools.executeTool('filesystem', 'read_file', {
44+
path: './file.txt'
45+
});
46+
47+
await codebolt.tools.executeTool('filesystem', 'write_file', {
48+
path: './output.txt',
49+
content: 'Hello World'
50+
});
51+
52+
// SQLite tools
53+
await codebolt.tools.executeTool('sqlite', 'list_tables', {
54+
random_string: 'test'
55+
});
56+
57+
await codebolt.tools.executeTool('sqlite', 'read_query', {
58+
query: 'SELECT * FROM users LIMIT 5'
59+
});

docs/api/apiaccess/tool/getAvailableToolBoxes.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ cbparameters:
88
signatureTypeName: Promise
99
description: A promise resolving to an array of registry toolbox configurations
1010
typeArgs:
11-
- type: any
11+
- type: array
1212
data:
1313
name: getAvailableToolBoxes
1414
category: tool
@@ -17,7 +17,19 @@ data:
1717
<CBBaseInfo/>
1818
<CBParameters/>
1919

20+
2021
### Example
2122
```js
22-
const availableToolBoxes = await codeboltMCP.getAvailableToolBoxes();
23-
console.log("Available ToolBoxes:", availableToolBoxes);
23+
const codebolt = require('@codebolt/codeboltjs');
24+
25+
26+
try {
27+
const getTools= await codebolt.tools.getEnabledToolBoxes();
28+
console.log('✅ Toolbox configuration result:', JSON.stringify(getTools, null, 2));
29+
} catch (error) {
30+
console.log('⚠️ Toolbox configuration failed:', error.message);
31+
}
32+
```
33+
34+
### Status
35+
Comming Soon....

docs/api/apiaccess/tool/getEnabledToolBoxes.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ cbparameters:
66
parameters: []
77
returns:
88
signatureTypeName: Promise
9-
description: A promise that resolves to an array of enabled toolbox configurations.
9+
description: A promise that resolves to an object containing enabled toolbox configurations with their details.
1010
typeArgs:
11-
- type: any
11+
- type: object
1212
data:
1313
name: getEnabledToolBoxes
1414
category: tool
@@ -17,7 +17,27 @@ data:
1717
<CBBaseInfo/>
1818
<CBParameters/>
1919

20+
### Response Structure
21+
```typescript
22+
{
23+
data: {
24+
[toolboxName: string]: {
25+
name: string;
26+
version?: string;
27+
description?: string;
28+
enabled: boolean;
29+
// Additional toolbox configuration properties
30+
}
31+
}
32+
}
33+
```
34+
2035
### Example
2136
```js
22-
const enabledToolBoxes = await codeboltMCP.getEnabledToolBoxes();
23-
console.log("Enabled ToolBoxes:", enabledToolBoxes);
37+
const codebolt = require('@codebolt/codeboltjs');
38+
39+
40+
const enabledToolBoxes = await codebolt.tools.getEnabledToolBoxes();
41+
console.log("Enabled ToolBoxes:", enabledToolBoxes);
42+
43+
```

docs/api/apiaccess/tool/getLocalToolBoxes.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ cbparameters:
88
signatureTypeName: Promise
99
description: A promise resolving to an array of locally available toolbox configurations
1010
typeArgs:
11-
- type: any
11+
- type: array
1212
data:
1313
name: getLocalToolBoxes
1414
category: tool
@@ -17,7 +17,24 @@ data:
1717
<CBBaseInfo/>
1818
<CBParameters/>
1919

20+
### Response Structure
21+
```typescript
22+
Array<{
23+
name: string;
24+
version?: string;
25+
description?: string;
26+
path?: string;
27+
// Additional local toolbox properties
28+
}>
29+
```
30+
2031
### Example
2132
```js
22-
const localToolBoxes = await codeboltMCP.getLocalToolBoxes();
23-
console.log("Local ToolBoxes:", localToolBoxes);
33+
const codebolt = require('@codebolt/codeboltjs');
34+
35+
36+
const localToolBoxes = await codebolt.tools.getLocalToolBoxes();
37+
console.log("Local ToolBoxes:", localToolBoxes);
38+
39+
40+
```
Lines changed: 70 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22
name: getMentionedToolBoxes
33
cbbaseinfo:
4-
description: Extracts toolbox mentions from a user message object.
4+
description: Extracts toolbox mentions from a user message object containing MCP references.
55
cbparameters:
66
parameters:
77
- name: userMessage
88
typeName: UserMessage
9-
description: Message object containing user input with toolbox mentions
9+
description: Message object containing user input with toolbox mentions in mentionedMCPs array
1010
returns:
1111
signatureTypeName: Promise
12-
description: A promise resolving to an array of mentioned toolbox names
12+
description: A promise resolving to a response object containing toolbox data and configuration
1313
typeArgs:
14-
- type: any
14+
- type: GetMentionedToolBoxesResponse
1515
data:
1616
name: getMentionedToolBoxes
1717
category: tool
@@ -20,11 +20,71 @@ data:
2020
<CBBaseInfo/>
2121
<CBParameters/>
2222

23-
### Example
23+
### UserMessage Structure
2424
```js
25-
const message = {
26-
content: "Please use @analyticsTools and @dataProcessing",
27-
mentionedMCPs: ["analyticsTools", "dataProcessing"]
25+
// UserMessage object structure
26+
const userMessage = {
27+
content: "Please use @sqlite and @filesystem for this task",
28+
mentionedMCPs: ["sqlite", "filesystem"] // Array of toolbox names mentioned
2829
};
29-
const mentioned = await codeboltMCP.getMentionedToolBoxes(message);
30-
console.log("Mentioned ToolBoxes:", mentioned);
30+
```
31+
32+
### Response Structure
33+
```js
34+
// GetMentionedToolBoxesResponse object structure
35+
const response = {
36+
data: {
37+
mcpServers: {
38+
// Each server has configuration details
39+
"filesystem": {
40+
command: "npx",
41+
args: ["-y", "@modelcontextprotocol/server-filesystem"]
42+
},
43+
"sqlite": {
44+
command: "npx",
45+
args: ["-y", "@modelcontextprotocol/server-sqlite"],
46+
env: {
47+
// Optional environment variables
48+
}
49+
}
50+
},
51+
enabled: [], // Array of enabled toolbox names
52+
codeboltTools: [] // Array of available Codebolt tool definitions
53+
},
54+
type: "getAvailableToolBoxesResponse"
55+
};
56+
```
57+
58+
### Example
59+
```js
60+
// Testing mentioned toolboxes from user message
61+
try {
62+
const message = {
63+
content: "Please use @sqlite and @filesystem for this task",
64+
mentionedMCPs: ["sqlite", "filesystem"]
65+
};
66+
67+
const mentionedToolBoxes = await codebolt.tools.getMentionedToolBoxes(message);
68+
console.log(' - Message content:', message.content);
69+
console.log(' - Mentioned MCPs:', message.mentionedMCPs);
70+
71+
// Extract available MCP servers from response
72+
const mcpServers = mentionedToolBoxes?.data?.mcpServers || {};
73+
const availableServers = Object.keys(mcpServers);
74+
console.log(' - Available MCP servers:', availableServers);
75+
console.log(' - Enabled toolboxes:', mentionedToolBoxes?.data?.enabled || []);
76+
77+
} catch (error) {
78+
console.log('⚠️ Getting mentioned toolboxes failed:', error.message);
79+
}
80+
```
81+
82+
### Error Handling
83+
```js
84+
try {
85+
const mentionedToolBoxes = await codebolt.tools.getMentionedToolBoxes(userMessage);
86+
console.log("Successfully retrieved toolbox data");
87+
} catch (error) {
88+
console.error("Getting mentioned toolboxes failed:", error.message);
89+
}
90+
```

docs/api/apiaccess/tool/getTools.md

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
2-
name: GetTools
2+
name: getTools
33
cbbaseinfo:
4-
description: Retrieves detailed information about specific tools from their toolboxes.
4+
description: Retrieves detailed information about specific tools from their toolboxes, including schemas and parameters.
55
cbparameters:
66
parameters:
77
- name: tools
88
typeName: "Array<{ toolbox: string, toolName: string }>"
9-
description: Array of tool identifiers to retrieve
9+
description: Array of tool identifiers specifying toolbox and tool name pairs
1010
returns:
1111
signatureTypeName: Promise
12-
description: A promise resolving to an array of tool configurations
12+
description: A promise resolving to an array of detailed tool configurations
1313
typeArgs:
14-
- type: any[]
14+
- type: array
1515
data:
16-
name: GetTools
16+
name: getTools
1717
category: tool
1818
link: getTools.md
1919
---
@@ -22,8 +22,33 @@ data:
2222

2323
### Example
2424
```js
25-
const toolInfo = await codeboltMCP.getTools([
26-
{ toolbox: "analyticsTools", toolName: "dataAnalyzer" },
27-
{ toolbox: "dataProcessing", toolName: "csvParser" }
25+
// Get details for specific tools
26+
const toolsToGet = [
27+
{ toolbox: 'filesystem', toolName: 'read_file' },
28+
{ toolbox: 'sqlite', toolName: 'list_tables' },
29+
{ toolbox: 'filesystem', toolName: 'write_file' }
30+
];
31+
32+
const toolDetails = await codeboltMCP.getTools(toolsToGet);
33+
console.log("Tool Details:", toolDetails);
34+
35+
// Process tool information
36+
console.log("Tools requested:", toolsToGet.length);
37+
console.log("Tool details received:", toolDetails?.length || 0);
38+
39+
```
40+
41+
### Single Tool Query
42+
```js
43+
// Get details for a single tool
44+
const singleTool = await codeboltMCP.getTools([
45+
{ toolbox: 'filesystem', toolName: 'read_file' }
2846
]);
29-
console.log("Tool Details:", toolInfo);
47+
48+
console.log(singleTool)
49+
50+
```
51+
52+
53+
### Status
54+
comming soon....

0 commit comments

Comments
 (0)