MCPcopy Index your code
hub / github.com/codeaashu/claude-code / parseAgentToolsFromFrontmatter

Function parseAgentToolsFromFrontmatter

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

Source from the content-addressed store, hash-verified

111 * Empty field = [] (no tools)
112 */
113export function parseAgentToolsFromFrontmatter(
114 toolsValue: unknown,
115): string[] | undefined {
116 const parsed = parseToolListString(toolsValue)
117 if (parsed === null) {
118 // For agents: undefined = all tools (undefined), null = no tools ([])
119 return toolsValue === undefined ? undefined : []
120 }
121 // If parsed contains '*', return undefined (all tools)
122 if (parsed.includes('*')) {
123 return undefined
124 }
125 return parsed
126}
127
128/**
129 * 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