MCPcopy Create free account
hub / github.com/WJX20/claude-code / getReadOnlyToolNames

Function getReadOnlyToolNames

src/utils/messages.ts:3334–3349  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3332}
3333
3334function getReadOnlyToolNames(): string {
3335 // Ant-native builds alias find/grep to embedded bfs/ugrep and remove the
3336 // dedicated Glob/Grep tools from the registry, so point at find/grep via
3337 // Bash instead.
3338 const tools = hasEmbeddedSearchTools()
3339 ? [FILE_READ_TOOL_NAME, '`find`', '`grep`']
3340 : [FILE_READ_TOOL_NAME, GLOB_TOOL_NAME, GREP_TOOL_NAME]
3341 const { allowedTools } = getCurrentProjectConfig()
3342 // allowedTools is a tool-name allowlist. find/grep are shell commands, not
3343 // tool names, so the filter is only meaningful for the non-embedded branch.
3344 const filtered =
3345 allowedTools && allowedTools.length > 0 && !hasEmbeddedSearchTools()
3346 ? tools.filter(t => allowedTools.includes(t))
3347 : tools
3348 return filtered.join(', ')
3349}
3350
3351/**
3352 * Iterative interview-based plan mode workflow.

Callers 1

Calls 2

hasEmbeddedSearchToolsFunction · 0.85
getCurrentProjectConfigFunction · 0.85

Tested by

no test coverage detected