MCPcopy
hub / github.com/codeaashu/claude-code / getValue

Function getValue

src/tools/ConfigTool/ConfigTool.ts:436–453  ·  view source on GitHub ↗
(source: 'global' | 'settings', path: string[])

Source from the content-addressed store, hash-verified

434} satisfies ToolDef<InputSchema, Output>)
435
436function getValue(source: 'global' | 'settings', path: string[]): unknown {
437 if (source === 'global') {
438 const config = getGlobalConfig()
439 const key = path[0]
440 if (!key) return undefined
441 return config[key as keyof GlobalConfig]
442 }
443 const settings = getInitialSettings()
444 let current: unknown = settings
445 for (const key of path) {
446 if (current && typeof current === 'object' && key in current) {
447 current = (current as Record<string, unknown>)[key]
448 } else {
449 return undefined
450 }
451 }
452 return current
453}
454
455function buildNestedObject(
456 path: string[],

Callers 1

callFunction · 0.85

Calls 2

getGlobalConfigFunction · 0.85
getInitialSettingsFunction · 0.85

Tested by

no test coverage detected