(segment: string)
| 72 | * @see https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta |
| 73 | */ |
| 74 | const splitLabels = (segment: string): string[] | null => { |
| 75 | const normalized = normalizeSegment(segment); |
| 76 | if (!normalized) return null; |
| 77 | |
| 78 | const labels = normalized.split("."); |
| 79 | if ( |
| 80 | labels.length === 0 || |
| 81 | labels.some((label) => !label || !META_PREFIX_LABEL_REGEX.test(label)) |
| 82 | ) { |
| 83 | return null; |
| 84 | } |
| 85 | |
| 86 | return labels; |
| 87 | }; |
| 88 | |
| 89 | /** |
| 90 | * Determines whether a metadata key is within the MCP-reserved namespace. |
no test coverage detected