MCPcopy Create free account
hub / github.com/modelcontextprotocol/inspector / extractMetaName

Function extractMetaName

client/src/utils/metaUtils.ts:138–148  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

136};
137
138const extractMetaName = (key: string): string => {
139 const trimmedKey = key.trim();
140 if (!trimmedKey) return "";
141
142 const slashIndex = trimmedKey.lastIndexOf("/");
143 if (slashIndex === -1) {
144 return trimmedKey;
145 }
146
147 return trimmedKey.slice(slashIndex + 1);
148};
149
150/**
151 * Validates the "name" portion of a metadata key, regardless of whether a prefix exists.

Callers 1

hasValidMetaNameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected