MCPcopy Index your code
hub / github.com/PatrickSys/codebase-context / createToolContext

Function createToolContext

src/index.ts:613–623  ·  view source on GitHub ↗
(project: ProjectState)

Source from the content-addressed store, hash-verified

611}
612
613function createToolContext(project: ProjectState): ToolContext {
614 return {
615 indexState: project.indexState,
616 paths: project.paths,
617 rootPath: project.rootPath,
618 project: buildProjectDescriptor(project.rootPath),
619 performIndexing: (incrementalOnly?: boolean) => performIndexing(project, incrementalOnly),
620 listProjects: () => listProjectDescriptors(),
621 getActiveProject: () => getActiveProjectDescriptor()
622 };
623}
624
625function createWorkspaceToolContext(): ToolContext {
626 const fallbackRootPath = primaryRootPath ?? path.resolve(process.cwd());

Callers 1

registerHandlersFunction · 0.85

Calls 4

buildProjectDescriptorFunction · 0.85
listProjectDescriptorsFunction · 0.85
performIndexingFunction · 0.70

Tested by

no test coverage detected