File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed
src/tools/atlasLocal/read Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -27,20 +27,18 @@ export class ListDeploymentsTool extends AtlasLocalToolBase {
2727 } ;
2828 }
2929
30- // Turn the deployments into a markdown table
31- const rows = deployments
32- . map ( ( deployment ) => {
33- return `${ deployment . name || "Unknown" } | ${ deployment . state } | ${ deployment . mongodbVersion } ` ;
34- } )
35- . join ( "\n" ) ;
30+ // Filter out the fields we want to return to the user
31+ // We don't want to return the entire deployment object because it contains too much data
32+ const deploymentsJson = deployments . map ( ( deployment ) => {
33+ return {
34+ name : deployment . name ,
35+ state : deployment . state ,
36+ mongodbVersion : deployment . mongodbVersion ,
37+ } ;
38+ } ) ;
3639
3740 return {
38- content : formatUntrustedData (
39- `Found ${ deployments . length } deployments:` ,
40- `Deployment Name | State | MongoDB Version
41- ----------------|----------------|----------------
42- ${ rows } `
43- ) ,
41+ content : formatUntrustedData ( "Deployments" , JSON . stringify ( deploymentsJson ) ) ,
4442 } ;
4543 }
4644}
You can’t perform that action at this time.
0 commit comments