server

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxEntityNameLength      = 255
	MaxEntityTypeLength      = 100
	MaxRelationTypeLength    = 100
	MaxObservationLength     = 5000
	MaxEntitiesPerRequest    = 1000
	MaxObservationsPerEntity = 100
	MaxSearchQueryLength     = 500
)

Variables

This section is empty.

Functions

func ValidateAddObservationsParams

func ValidateAddObservationsParams(params AddObservationsParams) error

ValidateAddObservationsParams validates parameters for adding observations

func ValidateCreateEntitiesParams

func ValidateCreateEntitiesParams(params CreateEntitiesParams) error

ValidateCreateEntitiesParams validates parameters for creating entities

func ValidateCreateRelationsParams

func ValidateCreateRelationsParams(params CreateRelationsParams) error

ValidateCreateRelationsParams validates parameters for creating relations

func ValidateDeleteEntitiesParams

func ValidateDeleteEntitiesParams(params DeleteEntitiesParams) error

ValidateDeleteEntitiesParams validates parameters for deleting entities

func ValidateEntityName

func ValidateEntityName(name string) error

ValidateEntityName validates an entity name

func ValidateEntityType

func ValidateEntityType(entityType string) error

ValidateEntityType validates an entity type

func ValidateObservation

func ValidateObservation(observation string) error

ValidateObservation validates an observation

func ValidateOpenNodesParams

func ValidateOpenNodesParams(params OpenNodesParams) error

ValidateOpenNodesParams validates parameters for opening nodes

func ValidateRelationType

func ValidateRelationType(relationType string) error

ValidateRelationType validates a relation type

func ValidateSearchNodesParams

func ValidateSearchNodesParams(params SearchNodesParams) error

ValidateSearchNodesParams validates parameters for searching nodes

func ValidateSearchQuery

func ValidateSearchQuery(query string) error

ValidateSearchQuery validates a search query

Types

type AddObservationsParams

type AddObservationsParams struct {
	Observations []ObservationInput `json:"observations" jsonschema:"description:Array of observations to add"`
}

type CreateEntitiesParams

type CreateEntitiesParams struct {
	Entities []database.EntityWithObservations `json:"entities" jsonschema:"description:Array of entities to create"`
}

type CreateRelationsParams

type CreateRelationsParams struct {
	Relations []database.RelationDTO `json:"relations" jsonschema:"description:Array of relations to create"`
}

type DeleteEntitiesParams

type DeleteEntitiesParams struct {
	EntityNames []string `json:"entityNames" jsonschema:"description:Array of entity names to delete"`
}

type DeleteObservationsParams

type DeleteObservationsParams struct {
	Deletions []DeletionInput `json:"deletions" jsonschema:"description:Array of deletions to perform"`
}

type DeleteRelationsParams

type DeleteRelationsParams struct {
	Relations []database.RelationDTO `json:"relations" jsonschema:"description:Array of relations to delete"`
}

type DeletionInput

type DeletionInput struct {
	EntityName   string   `json:"entityName" jsonschema:"description:Name of the entity"`
	Observations []string `json:"observations" jsonschema:"description:Array of observations to delete"`
}

type ObservationInput

type ObservationInput struct {
	EntityName string   `json:"entityName" jsonschema:"description:Name of the entity"`
	Contents   []string `json:"contents" jsonschema:"description:Array of observations to add"`
}

type OpenNodesParams

type OpenNodesParams struct {
	Names []string `json:"names" jsonschema:"description:Array of entity names to retrieve"`
}

type SearchNodesParams

type SearchNodesParams struct {
	Query string `` /* 189-byte string literal not displayed */
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServerWithLogger

func NewServerWithLogger(db *database.DB, logger *slog.Logger) *Server

NewServerWithLogger creates a new MCP memory server with a logger

func (*Server) RegisterTools

func (s *Server) RegisterTools(mcpServer *mcp.Server)

RegisterTools registers all MCP tools with the server

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the server

Jump to

Keyboard shortcuts

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