models

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package models defines the data structures used by the agent-browser application. It includes entity definitions for MCP servers, tools, and related data types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionState

type ConnectionState string

ConnectionState represents the state of a connection to an MCP server

const (
	// ConnectionStateDisconnected indicates the server is not connected
	ConnectionStateDisconnected ConnectionState = "disconnected"
	// ConnectionStateConnecting indicates a connection attempt is in progress
	ConnectionStateConnecting ConnectionState = "connecting"
	// ConnectionStateConnected indicates the server is successfully connected
	ConnectionStateConnected ConnectionState = "connected"
	// ConnectionStateFailed indicates the last connection attempt failed
	ConnectionStateFailed ConnectionState = "failed"
)

type FetchedTool

type FetchedTool struct {
	ID          string `json:"id"` // External ID
	Name        string `json:"name"`
	Description string `json:"description"`
}

FetchedTool represents the structure of tool data as fetched from an external MCP server's API. This may differ slightly from the stored Tool model (e.g., no internal ID, source server ID).

type MCPServer

type MCPServer struct {
	ID              int64           `db:"id" json:"id"`
	Name            string          `db:"name" json:"name"`
	URL             string          `db:"url" json:"url"`
	ConnectionState ConnectionState `db:"connection_state" json:"connection_state"`
	LastError       *string         `db:"last_error" json:"last_error,omitempty"`           // Pointer for nullability
	LastCheckedAt   *time.Time      `db:"last_checked_at" json:"last_checked_at,omitempty"` // Pointer for nullability
	CreatedAt       time.Time       `db:"created_at" json:"created_at"`
}

MCPServer represents a registered MCP server in the database.

type Tool

type Tool struct {
	ID             int64     `db:"id" json:"id"`
	ExternalID     string    `db:"external_id" json:"external_id"`           // Tool ID from the source MCP server
	SourceServerID int64     `db:"source_server_id" json:"source_server_id"` // Foreign key to mcp_servers
	Name           string    `db:"name" json:"name"`
	Description    string    `db:"description" json:"description,omitempty"`
	UpdatedAt      time.Time `db:"updated_at" json:"updated_at"`
	CreatedAt      time.Time `db:"created_at" json:"created_at"`
}

Tool represents tool metadata fetched from an MCP server and stored in the database.

Jump to

Keyboard shortcuts

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