What the host knows of the file
An entrypoint, as getToolEntrypoints returns it
const file = { name: "tune.abc", mimeType: "text/vnd.abc" };
const { tools } = await client.listTools();
// Let the user choose among these, next to the host's own viewer
const handlers = tools.filter(
(tool) =>
getToolFileArgument(tool) !== undefined &&
getToolEntrypoints(tool).some((entrypoint) =>
fileMatchesEntrypoint(file, entrypoint),
),
);
Check whether a file matches a
"file"entrypoint: an item of itsextensionsmatches the end of the file's name, or an item of itsmimeTypesmatches the file's media type. Both are compared without regard to case, and parameters of the file's media type are ignored.Returns
falsefor an entrypoint of another type or a malformed one, and skips list items that are neither a dot-prefixed extension nor a media type (type/subtype, or a whole type such asimage/*; a wildcard in place of the type matches nothing).