MCPcopy Create free account
hub / github.com/Noumena-Network/code / parseAgentToolsFromFrontmatter

Function parseAgentToolsFromFrontmatter

src/utils/markdownConfigLoader.ts:156–169  ·  view source on GitHub ↗
(
  toolsValue: unknown,
)

Source from the content-addressed store, hash-verified

154 * Empty field = [] (no tools)
155 */
156export function parseAgentToolsFromFrontmatter(
157 toolsValue: unknown,
158): string[] | undefined {
159 const parsed = parseToolListString(toolsValue)
160 if (parsed === null) {
161 // For agents: undefined = all tools (undefined), null = no tools ([])
162 return toolsValue === undefined ? undefined : []
163 }
164 // If parsed contains '*', return undefined (all tools)
165 if (parsed.includes('*')) {
166 return undefined
167 }
168 return parsed
169}
170
171/**
172 * Parse allowed-tools from slash command frontmatter

Callers 3

parseAgentFromJsonFunction · 0.85
parseAgentFromMarkdownFunction · 0.85
loadAgentFromFileFunction · 0.85

Calls 1

parseToolListStringFunction · 0.85

Tested by

no test coverage detected