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

Function updateMetadata

client/src/components/MetadataTab.tsx:56–71  ·  view source on GitHub ↗
(newEntries: MetadataEntry[])

Source from the content-addressed store, hash-verified

54 };
55
56 const updateMetadata = (newEntries: MetadataEntry[]) => {
57 const metadataObject: Record<string, string> = {};
58 newEntries.forEach(({ key, value }) => {
59 const trimmedKey = key.trim();
60 if (
61 trimmedKey &&
62 value.trim() &&
63 hasValidMetaPrefix(trimmedKey) &&
64 !isReservedMetaKey(trimmedKey) &&
65 hasValidMetaName(trimmedKey)
66 ) {
67 metadataObject[trimmedKey] = value.trim();
68 }
69 });
70 onMetadataChange(metadataObject);
71 };
72
73 return (
74 <TabsContent value="metadata">

Callers 2

removeEntryFunction · 0.85
updateEntryFunction · 0.85

Calls 3

hasValidMetaPrefixFunction · 0.90
isReservedMetaKeyFunction · 0.90
hasValidMetaNameFunction · 0.90

Tested by

no test coverage detected