Skip to content

Conversation

ochafik
Copy link
Contributor

@ochafik ochafik commented Oct 8, 2025

Follow up on #2830

Add outputType input:

  • resource: blob
  • resourceLink: needs to be read by uri after the fact

cc/ @crondinini-ant

@ochafik ochafik changed the title Add outputType to zip tool: (inlined /) resource link / resource everything: zip tool: add outputType to control resource vs. resource link output Oct 9, 2025
@ochafik ochafik closed this Oct 9, 2025
@ochafik ochafik reopened this Oct 9, 2025
domdomegg
domdomegg previously approved these changes Oct 10, 2025
Copy link
Member

@cliffhall cliffhall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How has this been tested? The Everything server doesn't have any file resources and if I try giving it a Resource URI it fails.

I tried fetch with a file url and Node v23.11.1 throws error, whether I included "file:///" or not:

TypeError: fetch failed
    at node:internal/deps/undici/undici:13510:13
  [cause]: Error: not implemented... yet...

When I ask Google about that, I get

The error TypeError: fetch failed with the cause Error: not implemented... yet... occurs because the fetch() function in Node.js does not support the file:// protocol for reading from the local file system.

The fetch() function is designed primarily for making network requests using protocols like http:// and https://.

To solve this issue, you must use Node.js's built-in File System (fs) module instead of fetch().

Seems like there might be at minimum a need to rewrite using fs.

import { readFile } from 'node:fs/promises';

async function useReadFile() {
  try {
    const filePath = '/Users/zaphod/question.txt';
    const fileContent = await readFile(filePath');
    console.log('File content:', fileContent);
  } catch (error) {
    console.error('Error reading file:', error);
  }
}

The Everything server doesn't have any resources that are files, so what is this tool supposed to fetch?

I'm worried that either implementation would allow fetching of arbitrary files.

Please do some testing and show your work so that we can duplicate it when testing on our side.

if (name === ToolName.ZIP_RESOURCES) {
const { files } = ZipResourcesInputSchema.parse(args);

const { files, outputType } = ZipResourcesInputSchema.parse(args);
Copy link
Member

@cliffhall cliffhall Oct 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be some validation that the files are within roots or are valid resources? If I asked for /etc/passwd would it zip up and return it?

@cliffhall cliffhall added wontfix This will not be worked on waiting for submitter Waiting for the submitter to provide more info labels Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting for submitter Waiting for the submitter to provide more info wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants