remove inlinedResourceLink

This commit is contained in:
Olivier Chafik
2025-10-09 16:07:38 +01:00
parent 893ee9c5b7
commit bd496fe7d8

View File

@@ -134,9 +134,8 @@ const ZipResourcesInputSchema = z.object({
files: z.record(z.string().url().describe("URL of the file to include in the zip")).describe("Mapping of file names to URLs to include in the zip"), files: z.record(z.string().url().describe("URL of the file to include in the zip")).describe("Mapping of file names to URLs to include in the zip"),
outputType: z.enum([ outputType: z.enum([
'resourceLink', 'resourceLink',
'inlinedResourceLink',
'resource' 'resource'
]).default('inlinedResourceLink').describe("How the resulting zip file should be returned. 'resourceLink' returns a linked to a resource that can be read later, 'inlinedResourceLink' returns a resource_link with a data URI, and 'resource' returns a full resource object."), ]).default('resource').describe("How the resulting zip file should be returned. 'resourceLink' returns a linked to a resource that can be read later, 'resource' returns a full resource object."),
}); });
enum ToolName { enum ToolName {
@@ -891,16 +890,6 @@ export const createServer = () => {
const blob = await zip.generateAsync({ type: "base64" }); const blob = await zip.generateAsync({ type: "base64" });
const mimeType = "application/zip"; const mimeType = "application/zip";
if (outputType === 'inlinedResourceLink') {
const uri = `data:${mimeType};base64,${blob}`;
return {
content: [{
type: "resource_link",
mimeType,
uri
}]
};
} else {
const name = `out_${Date.now()}.zip`; const name = `out_${Date.now()}.zip`;
const uri = `resource://${name}`; const uri = `resource://${name}`;
const resource = <Resource>{uri, name, mimeType, blob}; const resource = <Resource>{uri, name, mimeType, blob};
@@ -924,7 +913,6 @@ export const createServer = () => {
throw new Error(`Unknown outputType: ${outputType}`); throw new Error(`Unknown outputType: ${outputType}`);
} }
} }
}
if (name === ToolName.LIST_ROOTS) { if (name === ToolName.LIST_ROOTS) {
ListRootsSchema.parse(args); ListRootsSchema.parse(args);