neo4jschema

package
v0.19.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name               string   `yaml:"name" validate:"required"`
	Kind               string   `yaml:"kind" validate:"required"`
	Source             string   `yaml:"source" validate:"required"`
	Description        string   `yaml:"description" validate:"required"`
	AuthRequired       []string `yaml:"authRequired"`
	CacheExpireMinutes *int     `yaml:"cacheExpireMinutes,omitempty"` // Cache expiration time in minutes.
}

Config holds the configuration settings for the Neo4j schema tool. These settings are typically read from a YAML file.

func (Config) Initialize

func (cfg Config) Initialize(srcs map[string]sources.Source) (tools.Tool, error)

Initialize sets up the tool with its dependencies and returns a ready-to-use Tool instance.

func (Config) ToolConfigKind

func (cfg Config) ToolConfigKind() string

ToolConfigKind returns the kind of this tool configuration.

type Tool

type Tool struct {
	Name         string   `yaml:"name"`
	Kind         string   `yaml:"kind"`
	AuthRequired []string `yaml:"authRequired"`
	Driver       neo4j.DriverWithContext
	Database     string
	// contains filtered or unexported fields
}

Tool represents the Neo4j schema extraction tool. It holds the Neo4j driver, database information, and a cache for the schema.

func (Tool) Authorized

func (t Tool) Authorized(verifiedAuthServices []string) bool

Authorized checks if the tool is authorized to run based on the provided authentication services.

func (Tool) GetAPOCSchema

func (t Tool) GetAPOCSchema(ctx context.Context) ([]types.NodeLabel, []types.Relationship, *types.Statistics, error)

GetAPOCSchema extracts schema information using the APOC library, which provides detailed metadata.

func (Tool) GetSchemaWithoutAPOC

func (t Tool) GetSchemaWithoutAPOC(ctx context.Context, sampleSize int) ([]types.NodeLabel, []types.Relationship, *types.Statistics, error)

GetSchemaWithoutAPOC extracts schema information using native Cypher queries. This serves as a fallback for databases without APOC installed.

func (Tool) Invoke

func (t Tool) Invoke(ctx context.Context, params tools.ParamValues, accessToken tools.AccessToken) (any, error)

Invoke executes the tool's main logic: fetching the Neo4j schema. It first checks the cache for a valid schema before extracting it from the database.

func (Tool) Manifest

func (t Tool) Manifest() tools.Manifest

Manifest returns the tool's manifest, which describes its purpose and parameters.

func (Tool) McpManifest

func (t Tool) McpManifest() tools.McpManifest

McpManifest returns the machine-consumable manifest for the tool.

func (Tool) ParseParams

func (t Tool) ParseParams(data map[string]any, claimsMap map[string]map[string]any) (tools.ParamValues, error)

ParseParams is a placeholder as this tool does not require input parameters.

func (Tool) RequiresClientAuthorization added in v0.13.0

func (t Tool) RequiresClientAuthorization() bool

Directories

Path Synopsis
Package cache provides a simple, thread-safe, in-memory key-value store.
Package cache provides a simple, thread-safe, in-memory key-value store.
Package helpers provides utility functions for transforming and processing Neo4j schema data.
Package helpers provides utility functions for transforming and processing Neo4j schema data.
Package types contains the shared data structures for Neo4j schema representation.
Package types contains the shared data structures for Neo4j schema representation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL