Documentation
¶
Index ¶
- type Config
- type Tool
- func (t Tool) Authorized(verifiedAuthServices []string) bool
- func (t Tool) GetAPOCSchema(ctx context.Context) ([]types.NodeLabel, []types.Relationship, *types.Statistics, error)
- func (t Tool) GetSchemaWithoutAPOC(ctx context.Context, sampleSize int) ([]types.NodeLabel, []types.Relationship, *types.Statistics, error)
- func (t Tool) Invoke(ctx context.Context, params parameters.ParamValues, ...) (any, error)
- func (t Tool) Manifest() tools.Manifest
- func (t Tool) McpManifest() tools.McpManifest
- func (t Tool) ParseParams(data map[string]any, claimsMap map[string]map[string]any) (parameters.ParamValues, error)
- func (t Tool) RequiresClientAuthorization() bool
- func (t Tool) ToConfig() tools.ToolConfig
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 ¶
Initialize sets up the tool with its dependencies and returns a ready-to-use Tool instance.
func (Config) ToolConfigKind ¶
ToolConfigKind returns the kind of this tool configuration.
type Tool ¶
type Tool struct {
Config
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 ¶
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 parameters.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 ¶
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) (parameters.ParamValues, error)
ParseParams is a placeholder as this tool does not require input parameters.
func (Tool) RequiresClientAuthorization ¶ added in v0.13.0
func (Tool) ToConfig ¶ added in v0.20.0
func (t Tool) ToConfig() tools.ToolConfig
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. |