websearch

package
v1.37.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package websearch provides an HTTP client for go-search MCP server. Used by repo_search to discover repositories via web search.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client calls go-search MCP server via HTTP.

func NewClient

func NewClient(baseURL string) *Client

NewClient creates a go-search client targeting the given MCP base URL.

func (*Client) Search

func (c *Client) Search(ctx context.Context, query string) ([]Result, error)

Search calls go-search smart_search with depth=fast and returns raw results. The JSON-RPC envelope is built/parsed here; the HTTP transport (marshal, POST, decode) delegates to httputil.Client to avoid duplicating that plumbing (mirrors jaegerclient/promclient/dozorclient).

type Result

type Result struct {
	Title   string  `json:"title"`
	URL     string  `json:"url"`
	Content string  `json:"content"`
	Score   float64 `json:"score"`
}

Result is a single web search result.

Jump to

Keyboard shortcuts

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