{"record":{"id":"9b9c25d8c9cb8e0c","repo":"modelcontextprotocol/servers","slug":"unknown-outputtype-outputtype","errorCode":null,"errorMessage":"Unknown outputType: ${outputType}","messagePattern":"Unknown outputType: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/everything/tools/gzip-file-as-resource.ts","lineNumber":123,"sourceCode":"      blob\n    );\n\n    // Return the resource or a resource link that can be used to access this resource later\n    if (outputType === \"resource\") {\n      return {\n        content: [\n          {\n            type: \"resource\",\n            resource: { uri, mimeType, blob },\n          },\n        ],\n      };\n    } else if (outputType === \"resourceLink\") {\n      return {\n        content: [resourceLink],\n      };\n    } else {\n      throw new Error(`Unknown outputType: ${outputType}`);\n    }\n  });\n};\n\n/**\n * Validates a given data URI to ensure it follows the appropriate protocols and rules.\n *\n * @param {string} dataUri - The data URI to validate. Must be an HTTP, HTTPS, or data protocol URL. If a domain is provided, it must match the allowed domains list if applicable.\n * @return {URL} The validated and parsed URL object.\n * @throws {Error} If the data URI does not use a supported protocol or does not meet allowed domains criteria.\n */\nfunction validateDataURI(dataUri: string): URL {\n  // Validate Inputs\n  const url = new URL(dataUri);\n  try {\n    if (\n      url.protocol !== \"http:\" &&\n      url.protocol !== \"https:\" &&","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/modelcontextprotocol/servers/blob/76d64c822f5125032f89eb71dbdb94e42b434821/src/everything/tools/gzip-file-as-resource.ts#L105-L141","documentation":"Thrown by the `gzip-file-as-resource` tool when `outputType` is neither `\"resource\"` nor `\"resourceLink\"`. The zod schema (`z.enum([\"resourceLink\",\"resource\"]).default(\"resourceLink\")`) makes this effectively unreachable for SDK-routed calls; the branch is a defensive exhaustiveness check.","triggerScenarios":"Directly invoking the tool handler with a manually-crafted args object whose `outputType` is a third value, or a future schema change that adds an enum member without updating the if/else chain.","commonSituations":"Unit tests bypassing zod, refactors that widen the enum without updating the conditional, or downstream forks adding new output shapes.","solutions":["Omit `outputType` (defaults to `\"resourceLink\"`) or pass one of the two enum values.","If extending output types, update the zod enum AND the if/else chain together.","In tests, construct args via `GZipFileAsResourceSchema.parse(...)` to mirror real routing."],"exampleFix":"// before\ntoolHandler({ outputType: 'json' });\n// after\ntoolHandler({ outputType: 'resource' });","handlingStrategy":"type-guard","validationCode":"// schema already constrains to the enum; rely on routing\nconst args = GZipFileAsResourceSchema.parse(rawArgs);","typeGuard":"function isOutputType(v: unknown): v is 'resource' | 'resourceLink' {\n  return v === 'resource' || v === 'resourceLink';\n}","tryCatchPattern":null,"preventionTips":["Omit outputType (defaults to 'resourceLink') or pass a known enum value.","If you extend the enum, update the if/else chain in the same commit.","In tests, parse args through the schema to mirror real behavior."],"tags":["mcp","typescript","validation","everything-server","tools","defensive"],"backgroundTag":null,"analyzedSha":"76d64c822f5125032f89eb71dbdb94e42b434821","analyzedAt":"2026-08-12T10:02:41.718Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}