Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6f1dc4a

Browse files
committed
updated
1 parentb2d68f9 commit6f1dc4a

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 objectfor thetoolbox
11+
typeName:object
12+
description:Configuration objectcontainingtoolbox-specific settings
1313
returns:
1414
signatureTypeName:Promise
15-
description:A promise that resolveswhen configurationis complete
15+
description:A promise that resolveswith configurationresult 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+
###SimpleExample
2727
```js
28-
awaitcodeboltMCP.configureToolBox("analyticsTools", {
29-
apiKey:"12345",
30-
logging:true
28+
// Basic SQLite toolbox configuration
29+
constresult=awaitcodebolt.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+
###SimpleExample
3030
```js
31-
constresult=awaitcodeboltMCP.executeTool(
32-
"myToolBox",
33-
"dataProcessor",
34-
{ inputData:"test" }
35-
);
36-
console.log("Tool execution result:", result);
31+
// Read a file using filesystem toolbox
32+
constfsResult=awaitcodebolt.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+
awaitcodebolt.tools.executeTool('filesystem','read_file', {
44+
path:'./file.txt'
45+
});
46+
47+
awaitcodebolt.tools.executeTool('filesystem','write_file', {
48+
path:'./output.txt',
49+
content:'Hello World'
50+
});
51+
52+
// SQLite tools
53+
awaitcodebolt.tools.executeTool('sqlite','list_tables', {
54+
random_string:'test'
55+
});
56+
57+
awaitcodebolt.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-
constavailableToolBoxes=awaitcodeboltMCP.getAvailableToolBoxes();
23-
console.log("Available ToolBoxes:", availableToolBoxes);
23+
constcodebolt=require('@codebolt/codeboltjs');
24+
25+
26+
try {
27+
constgetTools=awaitcodebolt.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 anarray of enabled toolbox configurations.
9+
description:A promise that resolves to anobject 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-
constenabledToolBoxes=awaitcodeboltMCP.getEnabledToolBoxes();
23-
console.log("Enabled ToolBoxes:", enabledToolBoxes);
37+
constcodebolt=require('@codebolt/codeboltjs');
38+
39+
40+
constenabledToolBoxes=awaitcodebolt.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-
constlocalToolBoxes=awaitcodeboltMCP.getLocalToolBoxes();
23-
console.log("Local ToolBoxes:", localToolBoxes);
33+
constcodebolt=require('@codebolt/codeboltjs');
34+
35+
36+
constlocalToolBoxes=awaitcodebolt.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 toan array of mentioned toolboxnames
12+
description:A promise resolving toa response object containing toolboxdata 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-
constmessage= {
26-
content:"Please use @analyticsTools and @dataProcessing",
27-
mentionedMCPs: ["analyticsTools","dataProcessing"]
25+
// UserMessage object structure
26+
constuserMessage= {
27+
content:"Please use @sqlite and @filesystem for this task",
28+
mentionedMCPs: ["sqlite","filesystem"]// Array of toolbox names mentioned
2829
};
29-
constmentioned=awaitcodeboltMCP.getMentionedToolBoxes(message);
30-
console.log("Mentioned ToolBoxes:", mentioned);
30+
```
31+
32+
###Response Structure
33+
```js
34+
// GetMentionedToolBoxesResponse object structure
35+
constresponse= {
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+
constmessage= {
63+
content:"Please use @sqlite and @filesystem for this task",
64+
mentionedMCPs: ["sqlite","filesystem"]
65+
};
66+
67+
constmentionedToolBoxes=awaitcodebolt.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+
constmcpServers= mentionedToolBoxes?.data?.mcpServers|| {};
73+
constavailableServers=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+
constmentionedToolBoxes=awaitcodebolt.tools.getMentionedToolBoxes(userMessage);
86+
console.log("Successfully retrieved toolbox data");
87+
}catch (error) {
88+
console.error("Getting mentioned toolboxes failed:",error.message);
89+
}
90+
```
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 identifiersto retrieve
9+
description:Array of tool identifiersspecifying 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 ofdetailedtool 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-
consttoolInfo=awaitcodeboltMCP.getTools([
26-
{ toolbox:"analyticsTools", toolName:"dataAnalyzer" },
27-
{ toolbox:"dataProcessing", toolName:"csvParser" }
25+
// Get details for specific tools
26+
consttoolsToGet= [
27+
{ toolbox:'filesystem', toolName:'read_file' },
28+
{ toolbox:'sqlite', toolName:'list_tables' },
29+
{ toolbox:'filesystem', toolName:'write_file' }
30+
];
31+
32+
consttoolDetails=awaitcodeboltMCP.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+
constsingleTool=awaitcodeboltMCP.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)

[8]ページ先頭

©2009-2025 Movatter.jp