{"record":{"id":"5c1d9262452ce5ef","repo":"badges/shields","slug":"tool-not-found","errorCode":null,"errorMessage":"tool not found","messagePattern":"tool not found","errorType":"exception","errorClass":"NotFound","httpStatus":404,"severity":"error","filePath":"services/galaxytoolshed/galaxytoolshed-version.service.js","lineNumber":76,"sourceCode":"          },\n          {\n            name: 'tool',\n            example: 'fastq_dump',\n          },\n          {\n            name: 'requirement',\n            example: 'perl',\n          },\n        ),\n      },\n    },\n  }\n\n  static transform({ response, tool, requirement }) {\n    if (tool !== undefined) {\n      const dataTool = response[1].valid_tools.find(x => x.id === tool)\n      if (dataTool === undefined) {\n        throw new NotFound({ prettyMessage: 'tool not found' })\n      }\n      // Requirement version\n      if (requirement !== undefined) {\n        const dataRequirement = dataTool.requirements.find(\n          x => x.name === requirement,\n        )\n        if (dataRequirement === undefined) {\n          throw new NotFound({ prettyMessage: 'requirement not found' })\n        }\n        return dataRequirement.version\n      }\n      // Tool version\n      return dataTool.version\n    }\n    // Repository version\n    return response[1].changeset_revision\n  }\n","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/galaxytoolshed/galaxytoolshed-version.service.js#L58-L94","documentation":"Thrown in GalaxyToolshedVersionService.transform when the requested tool id is not present in the valid_tools list returned by the Tool Shed repository revision install info API. The service looks up response[1].valid_tools for an entry whose id matches the :tool parameter; if none matches, NotFound 'tool not found' is thrown.","triggerScenarios":"Requesting a version badge with a tool name that does not appear in the repository's valid_tools array — e.g. /galaxytoolshed/version/{repo}/{owner}/{tool} where the Tool Shed reports no tool with that id for the latest installable revision.","commonSituations":"Misspelled or wrong-cased tool id in the badge URL; the repository ships multiple tools and the requested one was renamed or removed; querying a revision where the tool metadata changed.","solutions":["Check the exact tool id in the repository's tool_dependencies or the Tool Shed UI","Query the Tool Shed install info API directly to list valid_tools for the latest revision","Update the badge URL to the correct tool id","Pin an older revision via a changeset revision if the tool existed there"],"exampleFix":"// before\n/galaxytoolshed/version/myrepo/myowner/missing_tool\n// after\n/galaxytoolshed/version/myrepo/myowner/data_manager_funannotate","handlingStrategy":"validation","validationCode":"const info = await fetch(`https://toolshed.g2.bx.psu.edu/api/repos/${owner}/${repo}`, { headers: { Accept: 'application/json' } }).then(r => r.json());const valid = info?.valid_tools?.some(t => t.id === toolId);if (!valid) console.warn(`tool ${toolId} not in valid_tools`);","typeGuard":"const hasTool = (resp, tool) => Array.isArray(resp?.valid_tools) && resp.valid_tools.some(t => t?.id === tool);","tryCatchPattern":"try { return await versionBadge({ repo, owner, tool }); } catch (e) { if (String(e.message).includes('tool not found')) { return fallbackBadge('unknown tool'); } throw e; }","preventionTips":["Copy tool ids verbatim from tool_dependencies.xml or the Tool Shed UI","Watch out for casing differences in tool ids","Re-check badge URLs when tools are renamed or removed from a repository"],"tags":["galaxytoolshed","not-found","tool-metadata"],"backgroundTag":"resource-not-found","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}