@@ -57,7 +57,7 @@ export class ContainerMcpAgent extends McpAgent<Env, {}, Props> {
5757 const userInBlocklist = await this . env . USER_BLOCKLIST . get ( this . props . user . id )
5858 if ( userInBlocklist ) {
5959 return {
60- content : [ { type : 'text' , text : " Blocked from intializing container." } ] ,
60+ content : [ { type : 'text' , text : ' Blocked from intializing container.' } ] ,
6161 }
6262 }
6363 return {
@@ -66,11 +66,16 @@ export class ContainerMcpAgent extends McpAgent<Env, {}, Props> {
6666 }
6767 )
6868
69- this . server . tool ( 'container_ping' , `Ping the container for liveliness. Use this tool to check if the container is running.` , { } , async ( { } ) => {
70- return {
71- content : [ { type : 'text' , text : await this . userContainer . container_ping ( ) } ] ,
69+ this . server . tool (
70+ 'container_ping' ,
71+ `Ping the container for liveliness. Use this tool to check if the container is running.` ,
72+ { } ,
73+ async ( { } ) => {
74+ return {
75+ content : [ { type : 'text' , text : await this . userContainer . container_ping ( ) } ] ,
76+ }
7277 }
73- } )
78+ )
7479 this . server . tool (
7580 'container_exec' ,
7681 `Run a command in a container and return the results from stdout.
@@ -106,22 +111,27 @@ export class ContainerMcpAgent extends McpAgent<Env, {}, Props> {
106111 }
107112 }
108113 )
109- this . server . tool ( 'container_files_list' , 'List working directory file tree. This just reads the contents of the current working directory' , { } , async ( { } ) => {
110- // Begin workaround using container read rather than ls:
111- const readFile = await this . userContainer . container_file_read ( '.' )
112- return {
113- content : [
114- {
115- type : 'resource' ,
116- resource : {
117- text : readFile . type === "text" ? readFile . textOutput : readFile . base64Output ,
118- uri : `file://` ,
119- mimeType : readFile . mimeType ,
114+ this . server . tool (
115+ 'container_files_list' ,
116+ 'List working directory file tree. This just reads the contents of the current working directory' ,
117+ { } ,
118+ async ( { } ) => {
119+ // Begin workaround using container read rather than ls:
120+ const readFile = await this . userContainer . container_file_read ( '.' )
121+ return {
122+ content : [
123+ {
124+ type : 'resource' ,
125+ resource : {
126+ text : readFile . type === 'text' ? readFile . textOutput : readFile . base64Output ,
127+ uri : `file://` ,
128+ mimeType : readFile . mimeType ,
129+ } ,
120130 } ,
121- } ,
122- ] ,
131+ ] ,
132+ }
123133 }
124- } )
134+ )
125135 this . server . tool (
126136 'container_file_read' ,
127137 'Read a specific file or directory. Use this tool if you would like to read files or display them to the user. This allow you to get a displayable image for the user if there is an image file.' ,
@@ -135,7 +145,7 @@ export class ContainerMcpAgent extends McpAgent<Env, {}, Props> {
135145 {
136146 type : 'resource' ,
137147 resource : {
138- text : readFile . type === " text" ? readFile . textOutput : readFile . base64Output ,
148+ text : readFile . type === ' text' ? readFile . textOutput : readFile . base64Output ,
139149 uri : `file://${ path } ` ,
140150 mimeType : readFile . mimeType ,
141151 } ,
0 commit comments