@kpritam/gremlin-mcp
Version:
A Gremlin MCP server that allows for fetching status, schema, and querying using Gremlin for any Gremlin-compatible graph database (TypeScript implementation).
968 lines • 33.1 kB
TypeScript
/**
* Data Models Module for Gremlin Graph Database.
*
* This module defines the core data structures and types used throughout the Gremlin
* graph database interface. It includes models for graph schema definitions and
* knowledge graph components. Compatible with any Gremlin-enabled database including
* Apache TinkerPop, Amazon Neptune, Azure Cosmos DB, etc.
*
* The models use Zod for clean, type-safe data structures that represent
* both the graph structure and its contents with runtime validation.
*/
import { z } from 'zod';
/**
* Represents a property definition for nodes and relationships in the graph.
*
* Properties are key-value pairs that can be attached to both nodes and
* relationships, storing additional metadata about these graph elements.
*/
export declare const PropertySchema: z.ZodObject<{
/** The name of the property */
name: z.ZodString;
/** The data type(s) of the property */
type: z.ZodArray<z.ZodString, "many">;
/** A list of sample values for the property (optional for schema size optimization) */
sample_values: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
/** Cardinality information (single, list, set) */
cardinality: z.ZodOptional<z.ZodString>;
/** A list of all possible values, if the property is determined to be an enum */
enum: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
}, "strip", z.ZodTypeAny, {
type: string[];
name: string;
sample_values?: unknown[] | undefined;
cardinality?: string | undefined;
enum?: unknown[] | undefined;
}, {
type: string[];
name: string;
sample_values?: unknown[] | undefined;
cardinality?: string | undefined;
enum?: unknown[] | undefined;
}>;
export type Property = z.infer<typeof PropertySchema>;
/**
* Defines a node type in the graph schema.
*
* Nodes represent entities in the graph database and can have labels
* and properties that describe their characteristics.
*/
export declare const NodeSchema: z.ZodObject<{
/** The label(s) that categorize this node type */
labels: z.ZodString;
/** List of properties that can be assigned to this node type */
properties: z.ZodDefault<z.ZodArray<z.ZodObject<{
/** The name of the property */
name: z.ZodString;
/** The data type(s) of the property */
type: z.ZodArray<z.ZodString, "many">;
/** A list of sample values for the property (optional for schema size optimization) */
sample_values: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
/** Cardinality information (single, list, set) */
cardinality: z.ZodOptional<z.ZodString>;
/** A list of all possible values, if the property is determined to be an enum */
enum: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
}, "strip", z.ZodTypeAny, {
type: string[];
name: string;
sample_values?: unknown[] | undefined;
cardinality?: string | undefined;
enum?: unknown[] | undefined;
}, {
type: string[];
name: string;
sample_values?: unknown[] | undefined;
cardinality?: string | undefined;
enum?: unknown[] | undefined;
}>, "many">>;
/** Count of vertices with this label */
count: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
labels: string;
properties: {
type: string[];
name: string;
sample_values?: unknown[] | undefined;
cardinality?: string | undefined;
enum?: unknown[] | undefined;
}[];
count?: number | undefined;
}, {
labels: string;
properties?: {
type: string[];
name: string;
sample_values?: unknown[] | undefined;
cardinality?: string | undefined;
enum?: unknown[] | undefined;
}[] | undefined;
count?: number | undefined;
}>;
export type Node = z.infer<typeof NodeSchema>;
/**
* Defines a relationship type in the graph schema.
*
* Relationships represent connections between nodes in the graph and can
* have their own properties to describe the nature of the connection.
*/
export declare const RelationshipSchema: z.ZodObject<{
/** The type/category of the relationship */
type: z.ZodString;
/** List of properties that can be assigned to this relationship type */
properties: z.ZodDefault<z.ZodArray<z.ZodObject<{
/** The name of the property */
name: z.ZodString;
/** The data type(s) of the property */
type: z.ZodArray<z.ZodString, "many">;
/** A list of sample values for the property (optional for schema size optimization) */
sample_values: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
/** Cardinality information (single, list, set) */
cardinality: z.ZodOptional<z.ZodString>;
/** A list of all possible values, if the property is determined to be an enum */
enum: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
}, "strip", z.ZodTypeAny, {
type: string[];
name: string;
sample_values?: unknown[] | undefined;
cardinality?: string | undefined;
enum?: unknown[] | undefined;
}, {
type: string[];
name: string;
sample_values?: unknown[] | undefined;
cardinality?: string | undefined;
enum?: unknown[] | undefined;
}>, "many">>;
/** Count of edges with this label */
count: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: string;
properties: {
type: string[];
name: string;
sample_values?: unknown[] | undefined;
cardinality?: string | undefined;
enum?: unknown[] | undefined;
}[];
count?: number | undefined;
}, {
type: string;
properties?: {
type: string[];
name: string;
sample_values?: unknown[] | undefined;
cardinality?: string | undefined;
enum?: unknown[] | undefined;
}[] | undefined;
count?: number | undefined;
}>;
export type Relationship = z.infer<typeof RelationshipSchema>;
/**
* Defines a valid relationship pattern between nodes in the graph.
*
* Relationship patterns describe the allowed connections between different
* types of nodes in the graph schema.
*/
export declare const RelationshipPatternSchema: z.ZodObject<{
/** The label of the source/starting node */
left_node: z.ZodString;
/** The label of the target/ending node */
right_node: z.ZodString;
/** The type of relationship connecting the nodes */
relation: z.ZodString;
}, "strip", z.ZodTypeAny, {
left_node: string;
right_node: string;
relation: string;
}, {
left_node: string;
right_node: string;
relation: string;
}>;
export type RelationshipPattern = z.infer<typeof RelationshipPatternSchema>;
/**
* Schema metadata for optimization information
*/
export declare const SchemaMetadataSchema: z.ZodObject<{
/** Total size of the schema in bytes */
schema_size_bytes: z.ZodOptional<z.ZodNumber>;
/** Number of node types */
node_count: z.ZodNumber;
/** Number of relationship types */
relationship_count: z.ZodNumber;
/** Number of relationship patterns */
pattern_count: z.ZodNumber;
/** Optimization settings used */
optimization_settings: z.ZodObject<{
sample_values_included: z.ZodBoolean;
max_enum_values: z.ZodNumber;
counts_included: z.ZodBoolean;
enum_cardinality_threshold: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
sample_values_included: boolean;
max_enum_values: number;
counts_included: boolean;
enum_cardinality_threshold: number;
}, {
sample_values_included: boolean;
max_enum_values: number;
counts_included: boolean;
enum_cardinality_threshold: number;
}>;
/** When the schema was generated */
generated_at: z.ZodString;
}, "strip", z.ZodTypeAny, {
node_count: number;
relationship_count: number;
pattern_count: number;
optimization_settings: {
sample_values_included: boolean;
max_enum_values: number;
counts_included: boolean;
enum_cardinality_threshold: number;
};
generated_at: string;
schema_size_bytes?: number | undefined;
}, {
node_count: number;
relationship_count: number;
pattern_count: number;
optimization_settings: {
sample_values_included: boolean;
max_enum_values: number;
counts_included: boolean;
enum_cardinality_threshold: number;
};
generated_at: string;
schema_size_bytes?: number | undefined;
}>;
export type SchemaMetadata = z.infer<typeof SchemaMetadataSchema>;
/**
* Represents the complete schema definition for the graph database.
*
* The graph schema defines all possible node types, relationship types,
* and valid patterns of connections between nodes.
*/
export declare const GraphSchemaSchema: z.ZodObject<{
/** List of all node types defined in the schema */
nodes: z.ZodArray<z.ZodObject<{
/** The label(s) that categorize this node type */
labels: z.ZodString;
/** List of properties that can be assigned to this node type */
properties: z.ZodDefault<z.ZodArray<z.ZodObject<{
/** The name of the property */
name: z.ZodString;
/** The data type(s) of the property */
type: z.ZodArray<z.ZodString, "many">;
/** A list of sample values for the property (optional for schema size optimization) */
sample_values: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
/** Cardinality information (single, list, set) */
cardinality: z.ZodOptional<z.ZodString>;
/** A list of all possible values, if the property is determined to be an enum */
enum: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
}, "strip", z.ZodTypeAny, {
type: string[];
name: string;
sample_values?: unknown[] | undefined;
cardinality?: string | undefined;
enum?: unknown[] | undefined;
}, {
type: string[];
name: string;
sample_values?: unknown[] | undefined;
cardinality?: string | undefined;
enum?: unknown[] | undefined;
}>, "many">>;
/** Count of vertices with this label */
count: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
labels: string;
properties: {
type: string[];
name: string;
sample_values?: unknown[] | undefined;
cardinality?: string | undefined;
enum?: unknown[] | undefined;
}[];
count?: number | undefined;
}, {
labels: string;
properties?: {
type: string[];
name: string;
sample_values?: unknown[] | undefined;
cardinality?: string | undefined;
enum?: unknown[] | undefined;
}[] | undefined;
count?: number | undefined;
}>, "many">;
/** List of all relationship types defined in the schema */
relationships: z.ZodArray<z.ZodObject<{
/** The type/category of the relationship */
type: z.ZodString;
/** List of properties that can be assigned to this relationship type */
properties: z.ZodDefault<z.ZodArray<z.ZodObject<{
/** The name of the property */
name: z.ZodString;
/** The data type(s) of the property */
type: z.ZodArray<z.ZodString, "many">;
/** A list of sample values for the property (optional for schema size optimization) */
sample_values: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
/** Cardinality information (single, list, set) */
cardinality: z.ZodOptional<z.ZodString>;
/** A list of all possible values, if the property is determined to be an enum */
enum: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
}, "strip", z.ZodTypeAny, {
type: string[];
name: string;
sample_values?: unknown[] | undefined;
cardinality?: string | undefined;
enum?: unknown[] | undefined;
}, {
type: string[];
name: string;
sample_values?: unknown[] | undefined;
cardinality?: string | undefined;
enum?: unknown[] | undefined;
}>, "many">>;
/** Count of edges with this label */
count: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: string;
properties: {
type: string[];
name: string;
sample_values?: unknown[] | undefined;
cardinality?: string | undefined;
enum?: unknown[] | undefined;
}[];
count?: number | undefined;
}, {
type: string;
properties?: {
type: string[];
name: string;
sample_values?: unknown[] | undefined;
cardinality?: string | undefined;
enum?: unknown[] | undefined;
}[] | undefined;
count?: number | undefined;
}>, "many">;
/** List of valid relationship patterns between nodes */
relationship_patterns: z.ZodArray<z.ZodObject<{
/** The label of the source/starting node */
left_node: z.ZodString;
/** The label of the target/ending node */
right_node: z.ZodString;
/** The type of relationship connecting the nodes */
relation: z.ZodString;
}, "strip", z.ZodTypeAny, {
left_node: string;
right_node: string;
relation: string;
}, {
left_node: string;
right_node: string;
relation: string;
}>, "many">;
/** Schema metadata and optimization information */
metadata: z.ZodOptional<z.ZodObject<{
/** Total size of the schema in bytes */
schema_size_bytes: z.ZodOptional<z.ZodNumber>;
/** Number of node types */
node_count: z.ZodNumber;
/** Number of relationship types */
relationship_count: z.ZodNumber;
/** Number of relationship patterns */
pattern_count: z.ZodNumber;
/** Optimization settings used */
optimization_settings: z.ZodObject<{
sample_values_included: z.ZodBoolean;
max_enum_values: z.ZodNumber;
counts_included: z.ZodBoolean;
enum_cardinality_threshold: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
sample_values_included: boolean;
max_enum_values: number;
counts_included: boolean;
enum_cardinality_threshold: number;
}, {
sample_values_included: boolean;
max_enum_values: number;
counts_included: boolean;
enum_cardinality_threshold: number;
}>;
/** When the schema was generated */
generated_at: z.ZodString;
}, "strip", z.ZodTypeAny, {
node_count: number;
relationship_count: number;
pattern_count: number;
optimization_settings: {
sample_values_included: boolean;
max_enum_values: number;
counts_included: boolean;
enum_cardinality_threshold: number;
};
generated_at: string;
schema_size_bytes?: number | undefined;
}, {
node_count: number;
relationship_count: number;
pattern_count: number;
optimization_settings: {
sample_values_included: boolean;
max_enum_values: number;
counts_included: boolean;
enum_cardinality_threshold: number;
};
generated_at: string;
schema_size_bytes?: number | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
nodes: {
labels: string;
properties: {
type: string[];
name: string;
sample_values?: unknown[] | undefined;
cardinality?: string | undefined;
enum?: unknown[] | undefined;
}[];
count?: number | undefined;
}[];
relationships: {
type: string;
properties: {
type: string[];
name: string;
sample_values?: unknown[] | undefined;
cardinality?: string | undefined;
enum?: unknown[] | undefined;
}[];
count?: number | undefined;
}[];
relationship_patterns: {
left_node: string;
right_node: string;
relation: string;
}[];
metadata?: {
node_count: number;
relationship_count: number;
pattern_count: number;
optimization_settings: {
sample_values_included: boolean;
max_enum_values: number;
counts_included: boolean;
enum_cardinality_threshold: number;
};
generated_at: string;
schema_size_bytes?: number | undefined;
} | undefined;
}, {
nodes: {
labels: string;
properties?: {
type: string[];
name: string;
sample_values?: unknown[] | undefined;
cardinality?: string | undefined;
enum?: unknown[] | undefined;
}[] | undefined;
count?: number | undefined;
}[];
relationships: {
type: string;
properties?: {
type: string[];
name: string;
sample_values?: unknown[] | undefined;
cardinality?: string | undefined;
enum?: unknown[] | undefined;
}[] | undefined;
count?: number | undefined;
}[];
relationship_patterns: {
left_node: string;
right_node: string;
relation: string;
}[];
metadata?: {
node_count: number;
relationship_count: number;
pattern_count: number;
optimization_settings: {
sample_values_included: boolean;
max_enum_values: number;
counts_included: boolean;
enum_cardinality_threshold: number;
};
generated_at: string;
schema_size_bytes?: number | undefined;
} | undefined;
}>;
export type GraphSchema = z.infer<typeof GraphSchemaSchema>;
/**
* Gremlin configuration schema
*/
export declare const GremlinConfigSchema: z.ZodObject<{
/** Host address of the Gremlin server */
host: z.ZodString;
/** Port number of the Gremlin server */
port: z.ZodNumber;
/** Traversal source name */
traversalSource: z.ZodString;
/** Whether to use SSL/TLS connection */
useSSL: z.ZodBoolean;
/** Optional username for authentication */
username: z.ZodOptional<z.ZodString>;
/** Optional password for authentication */
password: z.ZodOptional<z.ZodString>;
/** Idle timeout in seconds */
idleTimeoutSeconds: z.ZodNumber;
/** Whether enum discovery is enabled */
enumDiscoveryEnabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
/** Cardinality threshold for enum discovery */
enumCardinalityThreshold: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
/** List of property names to exclude from enum discovery */
enumPropertyBlacklist: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
/** Whether to include sample values in schema (for size optimization) */
includeSampleValues: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
/** Maximum number of enum values to include (for size optimization) */
maxEnumValues: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
/** Whether to include vertex/edge counts in schema */
includeCounts: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
}, "strip", z.ZodTypeAny, {
host: string;
port: number;
traversalSource: string;
useSSL: boolean;
idleTimeoutSeconds: number;
enumDiscoveryEnabled: boolean;
enumCardinalityThreshold: number;
enumPropertyBlacklist: string[];
includeSampleValues: boolean;
maxEnumValues: number;
includeCounts: boolean;
username?: string | undefined;
password?: string | undefined;
}, {
host: string;
port: number;
traversalSource: string;
useSSL: boolean;
idleTimeoutSeconds: number;
username?: string | undefined;
password?: string | undefined;
enumDiscoveryEnabled?: boolean | undefined;
enumCardinalityThreshold?: number | undefined;
enumPropertyBlacklist?: string[] | undefined;
includeSampleValues?: boolean | undefined;
maxEnumValues?: number | undefined;
includeCounts?: boolean | undefined;
}>;
export type GremlinConfig = z.infer<typeof GremlinConfigSchema>;
/**
* Gremlin vertex with full structure
*/
export declare const GremlinVertexSchema: z.ZodObject<{
id: z.ZodUnknown;
label: z.ZodString;
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnknown, "many">>>;
type: z.ZodLiteral<"vertex">;
}, "strip", z.ZodTypeAny, {
type: "vertex";
label: string;
properties?: Record<string, unknown[]> | undefined;
id?: unknown;
}, {
type: "vertex";
label: string;
properties?: Record<string, unknown[]> | undefined;
id?: unknown;
}>;
export type GremlinVertex = z.infer<typeof GremlinVertexSchema>;
/**
* Gremlin edge with full structure
*/
export declare const GremlinEdgeSchema: z.ZodObject<{
id: z.ZodUnknown;
label: z.ZodString;
inV: z.ZodUnknown;
outV: z.ZodUnknown;
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnknown, "many">>>;
type: z.ZodLiteral<"edge">;
}, "strip", z.ZodTypeAny, {
type: "edge";
label: string;
properties?: Record<string, unknown[]> | undefined;
id?: unknown;
inV?: unknown;
outV?: unknown;
}, {
type: "edge";
label: string;
properties?: Record<string, unknown[]> | undefined;
id?: unknown;
inV?: unknown;
outV?: unknown;
}>;
export type GremlinEdge = z.infer<typeof GremlinEdgeSchema>;
/**
* Gremlin property map (from valueMap() queries)
*/
export declare const GremlinPropertyMapSchema: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnknown, "many">>;
export type GremlinPropertyMap = z.infer<typeof GremlinPropertyMapSchema>;
/**
* Gremlin path result (from path() queries)
*/
export declare const GremlinPathSchema: z.ZodObject<{
labels: z.ZodArray<z.ZodString, "many">;
objects: z.ZodArray<z.ZodUnknown, "many">;
type: z.ZodLiteral<"path">;
}, "strip", z.ZodTypeAny, {
type: "path";
labels: string[];
objects: unknown[];
}, {
type: "path";
labels: string[];
objects: unknown[];
}>;
export type GremlinPath = z.infer<typeof GremlinPathSchema>;
/**
* Gremlin property result (individual Property/VertexProperty instances)
*/
export declare const GremlinPropertySchema: z.ZodObject<{
key: z.ZodString;
value: z.ZodUnknown;
type: z.ZodLiteral<"property">;
}, "strip", z.ZodTypeAny, {
type: "property";
key: string;
value?: unknown;
}, {
type: "property";
key: string;
value?: unknown;
}>;
export type GremlinProperty = z.infer<typeof GremlinPropertySchema>;
/**
* Discriminated union for structured Gremlin result types
*/
export declare const GremlinStructuredResultSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
id: z.ZodUnknown;
label: z.ZodString;
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnknown, "many">>>;
type: z.ZodLiteral<"vertex">;
}, "strip", z.ZodTypeAny, {
type: "vertex";
label: string;
properties?: Record<string, unknown[]> | undefined;
id?: unknown;
}, {
type: "vertex";
label: string;
properties?: Record<string, unknown[]> | undefined;
id?: unknown;
}>, z.ZodObject<{
id: z.ZodUnknown;
label: z.ZodString;
inV: z.ZodUnknown;
outV: z.ZodUnknown;
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnknown, "many">>>;
type: z.ZodLiteral<"edge">;
}, "strip", z.ZodTypeAny, {
type: "edge";
label: string;
properties?: Record<string, unknown[]> | undefined;
id?: unknown;
inV?: unknown;
outV?: unknown;
}, {
type: "edge";
label: string;
properties?: Record<string, unknown[]> | undefined;
id?: unknown;
inV?: unknown;
outV?: unknown;
}>, z.ZodObject<{
labels: z.ZodArray<z.ZodString, "many">;
objects: z.ZodArray<z.ZodUnknown, "many">;
type: z.ZodLiteral<"path">;
}, "strip", z.ZodTypeAny, {
type: "path";
labels: string[];
objects: unknown[];
}, {
type: "path";
labels: string[];
objects: unknown[];
}>, z.ZodObject<{
key: z.ZodString;
value: z.ZodUnknown;
type: z.ZodLiteral<"property">;
}, "strip", z.ZodTypeAny, {
type: "property";
key: string;
value?: unknown;
}, {
type: "property";
key: string;
value?: unknown;
}>]>;
/**
* Union type for all possible Gremlin result types (including primitives)
*/
export declare const GremlinResultItemSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
id: z.ZodUnknown;
label: z.ZodString;
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnknown, "many">>>;
type: z.ZodLiteral<"vertex">;
}, "strip", z.ZodTypeAny, {
type: "vertex";
label: string;
properties?: Record<string, unknown[]> | undefined;
id?: unknown;
}, {
type: "vertex";
label: string;
properties?: Record<string, unknown[]> | undefined;
id?: unknown;
}>, z.ZodObject<{
id: z.ZodUnknown;
label: z.ZodString;
inV: z.ZodUnknown;
outV: z.ZodUnknown;
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnknown, "many">>>;
type: z.ZodLiteral<"edge">;
}, "strip", z.ZodTypeAny, {
type: "edge";
label: string;
properties?: Record<string, unknown[]> | undefined;
id?: unknown;
inV?: unknown;
outV?: unknown;
}, {
type: "edge";
label: string;
properties?: Record<string, unknown[]> | undefined;
id?: unknown;
inV?: unknown;
outV?: unknown;
}>, z.ZodObject<{
labels: z.ZodArray<z.ZodString, "many">;
objects: z.ZodArray<z.ZodUnknown, "many">;
type: z.ZodLiteral<"path">;
}, "strip", z.ZodTypeAny, {
type: "path";
labels: string[];
objects: unknown[];
}, {
type: "path";
labels: string[];
objects: unknown[];
}>, z.ZodObject<{
key: z.ZodString;
value: z.ZodUnknown;
type: z.ZodLiteral<"property">;
}, "strip", z.ZodTypeAny, {
type: "property";
key: string;
value?: unknown;
}, {
type: "property";
key: string;
value?: unknown;
}>]>, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnknown, "many">>, z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnknown, "many">, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
export type GremlinStructuredResult = z.infer<typeof GremlinStructuredResultSchema>;
export type GremlinResultItem = z.infer<typeof GremlinResultItemSchema>;
/**
* Gremlin query result structure with properly typed results
*/
export declare const GremlinQueryResultSchema: z.ZodObject<{
/** Query results array with typed items */
results: z.ZodArray<z.ZodUnion<[z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
id: z.ZodUnknown;
label: z.ZodString;
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnknown, "many">>>;
type: z.ZodLiteral<"vertex">;
}, "strip", z.ZodTypeAny, {
type: "vertex";
label: string;
properties?: Record<string, unknown[]> | undefined;
id?: unknown;
}, {
type: "vertex";
label: string;
properties?: Record<string, unknown[]> | undefined;
id?: unknown;
}>, z.ZodObject<{
id: z.ZodUnknown;
label: z.ZodString;
inV: z.ZodUnknown;
outV: z.ZodUnknown;
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnknown, "many">>>;
type: z.ZodLiteral<"edge">;
}, "strip", z.ZodTypeAny, {
type: "edge";
label: string;
properties?: Record<string, unknown[]> | undefined;
id?: unknown;
inV?: unknown;
outV?: unknown;
}, {
type: "edge";
label: string;
properties?: Record<string, unknown[]> | undefined;
id?: unknown;
inV?: unknown;
outV?: unknown;
}>, z.ZodObject<{
labels: z.ZodArray<z.ZodString, "many">;
objects: z.ZodArray<z.ZodUnknown, "many">;
type: z.ZodLiteral<"path">;
}, "strip", z.ZodTypeAny, {
type: "path";
labels: string[];
objects: unknown[];
}, {
type: "path";
labels: string[];
objects: unknown[];
}>, z.ZodObject<{
key: z.ZodString;
value: z.ZodUnknown;
type: z.ZodLiteral<"property">;
}, "strip", z.ZodTypeAny, {
type: "property";
key: string;
value?: unknown;
}, {
type: "property";
key: string;
value?: unknown;
}>]>, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnknown, "many">>, z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnknown, "many">, z.ZodRecord<z.ZodString, z.ZodUnknown>]>, "many">;
/** Status message about the query execution */
message: z.ZodString;
}, "strip", z.ZodTypeAny, {
message: string;
results: (string | number | boolean | unknown[] | Record<string, unknown[]> | {
type: "vertex";
label: string;
properties?: Record<string, unknown[]> | undefined;
id?: unknown;
} | {
type: "edge";
label: string;
properties?: Record<string, unknown[]> | undefined;
id?: unknown;
inV?: unknown;
outV?: unknown;
} | {
type: "path";
labels: string[];
objects: unknown[];
} | {
type: "property";
key: string;
value?: unknown;
} | Record<string, unknown> | null)[];
}, {
message: string;
results: (string | number | boolean | unknown[] | Record<string, unknown[]> | {
type: "vertex";
label: string;
properties?: Record<string, unknown[]> | undefined;
id?: unknown;
} | {
type: "edge";
label: string;
properties?: Record<string, unknown[]> | undefined;
id?: unknown;
inV?: unknown;
outV?: unknown;
} | {
type: "path";
labels: string[];
objects: unknown[];
} | {
type: "property";
key: string;
value?: unknown;
} | Record<string, unknown> | null)[];
}>;
export type GremlinQueryResult = z.infer<typeof GremlinQueryResultSchema>;
/**
* Input schema for Gremlin query tool
*/
export declare const GremlinQueryInputSchema: z.ZodObject<{
query: z.ZodString;
}, "strip", z.ZodTypeAny, {
query: string;
}, {
query: string;
}>;
export type GremlinQueryInput = z.infer<typeof GremlinQueryInputSchema>;
/**
* Input schema for import operations
*/
export declare const ImportDataInputSchema: z.ZodObject<{
format: z.ZodEnum<["graphson", "csv"]>;
data: z.ZodString;
options: z.ZodOptional<z.ZodObject<{
clear_graph: z.ZodOptional<z.ZodBoolean>;
batch_size: z.ZodOptional<z.ZodNumber>;
validate_schema: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
clear_graph?: boolean | undefined;
batch_size?: number | undefined;
validate_schema?: boolean | undefined;
}, {
clear_graph?: boolean | undefined;
batch_size?: number | undefined;
validate_schema?: boolean | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
format: "graphson" | "csv";
data: string;
options?: {
clear_graph?: boolean | undefined;
batch_size?: number | undefined;
validate_schema?: boolean | undefined;
} | undefined;
}, {
format: "graphson" | "csv";
data: string;
options?: {
clear_graph?: boolean | undefined;
batch_size?: number | undefined;
validate_schema?: boolean | undefined;
} | undefined;
}>;
export type ImportDataInput = z.infer<typeof ImportDataInputSchema>;
/**
* Input schema for export operations
*/
export declare const ExportSubgraphInputSchema: z.ZodObject<{
traversal_query: z.ZodString;
format: z.ZodEnum<["graphson", "json", "csv"]>;
include_properties: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
exclude_properties: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
max_depth: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
format: "graphson" | "csv" | "json";
traversal_query: string;
include_properties?: string[] | undefined;
exclude_properties?: string[] | undefined;
max_depth?: number | undefined;
}, {
format: "graphson" | "csv" | "json";
traversal_query: string;
include_properties?: string[] | undefined;
exclude_properties?: string[] | undefined;
max_depth?: number | undefined;
}>;
export type ExportSubgraphInput = z.infer<typeof ExportSubgraphInputSchema>;
//# sourceMappingURL=models.d.ts.map