File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ export const createFileReadTool: ToolFactory = (config: ToolConfiguration) => {
1818 inputSchema : TOOL_DEFINITIONS . file_read . schema ,
1919 toModelOutput : ( output : FileReadToolResult ) => {
2020 // If this is an image file with a mime type, return it as media content
21- if ( output . success && output . mime_type && output . mime_type . startsWith ( "image/" ) ) {
21+ if ( output . success && output . mime_type ? .startsWith ( "image/" ) ) {
2222 return {
2323 type : "content" ,
2424 value : [
@@ -78,7 +78,7 @@ export const createFileReadTool: ToolFactory = (config: ToolConfiguration) => {
7878 const mimeType = mime . lookup ( resolvedPath ) || undefined ;
7979
8080 // Check if this is a binary image file
81- if ( mimeType && mimeType . startsWith ( "image/" ) ) {
81+ if ( mimeType ? .startsWith ( "image/" ) ) {
8282 // Read as binary and encode as base64 for images
8383 const buffer = await fs . readFile ( resolvedPath ) ;
8484 const base64Content = buffer . toString ( "base64" ) ;
You can’t perform that action at this time.
0 commit comments