youspot

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 11 Imported by: 0

README

youspot-go

The official Go client for YouSpot, the AI-native personal CRM. Standard library only, Go 1.21 or newer.

go get github.com/OnStartups/youspot-go

Everything except CallTool works with no credential. Every YouSpot tool reads one person's own contacts, companies, notes and files, so a token always belongs to a person: mint one at youspot.com/user/mcp and set YOUSPOT_TOKEN, or follow the OAuth 2.1 flow in auth.md.

package main

import (
	"context"
	"fmt"

	youspot "github.com/OnStartups/youspot-go"
)

func main() {
	ctx := context.Background()
	c := youspot.New()

	answer, err := c.Ask(ctx, "how do I connect an MCP client", 3)
	if err != nil {
		panic(err)
	}
	fmt.Println(answer["answer"])

	tools, _ := c.Tools(ctx)
	fmt.Println(string(tools))

	demo, _ := c.CallSandboxTool(ctx, "search_graph_objects", map[string]any{"query": "consulting"})
	fmt.Println(string(demo))

	summary, err := c.CallTool(ctx, "get_connections_summary", nil)
	if err != nil {
		fmt.Println(err)
	}
	fmt.Println(string(summary))
}
Method What it does Credential
Index Every endpoint, and what each one costs in credentials none
Ask A question about YouSpot, answered from its own pages none
SearchDocs, ReadDoc, ListDocs The developer docs over the documentation MCP server none
ReadMarkdown Any public page as markdown none
Tools The tools on the product MCP server none
CallTool One tool, as the member whose token the client holds YOUSPOT_TOKEN
SandboxTools, CallSandboxTool The read tools over a demo account none
Member, Directory Public profiles and the public directory none
Batch Up to 20 reads in one round trip none
Identity What identity the caller can hold here optional

Every failure is a *youspot.Error carrying the HTTP status, the stable error code and the URL. YOUSPOT_BASE_URL overrides the origin.

The machine descriptions this client follows: openapi.json, the MCP server card, agents.md and llms.txt. Developer docs: https://youspot.com/docs.

MIT licensed. Support: support@youspot.com.

Documentation

Overview

Package youspot is the official Go client for YouSpot, the AI-native personal CRM: the same surface as the youspot npm and PyPI packages.

Everything except CallTool works with no credential. CallTool needs a member's token, because every tool reads one person's own CRM; the sandbox runs the read tools against a demo account with no credential.

Index

Constants

View Source
const DefaultBaseURL = "https://youspot.com"

DefaultBaseURL is where youspot.com answers; YOUSPOT_BASE_URL overrides it.

View Source
const Version = "0.1.0"

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchItem

type BatchItem struct {
	ID    string            `json:"id,omitempty"`
	Path  string            `json:"path"`
	Query map[string]string `json:"query,omitempty"`
}

BatchItem is one read inside a Batch call.

type Client

type Client struct {
	BaseURL    string
	Token      string
	HTTPClient *http.Client
}

Client talks to one YouSpot origin. The zero value is usable.

func New

func New() *Client

New returns a client for YOUSPOT_BASE_URL (or youspot.com), reading a member token from YOUSPOT_TOKEN when one is set.

func (*Client) Ask

func (c *Client) Ask(ctx context.Context, query string, limit int) (map[string]any, error)

Ask answers a question about YouSpot from its own public pages.

func (*Client) Batch

func (c *Client) Batch(ctx context.Context, items []BatchItem) (map[string]any, error)

Batch runs up to 20 reads in one round trip; each answer carries its own status and body.

func (*Client) CallSandboxTool

func (c *Client) CallSandboxTool(ctx context.Context, name string, arguments map[string]any) (json.RawMessage, error)

CallSandboxTool runs a read tool against the demo account. No credential.

func (*Client) CallTool

func (c *Client) CallTool(ctx context.Context, name string, arguments map[string]any) (json.RawMessage, error)

CallTool calls one tool on the product MCP server as the member whose token the client holds.

func (*Client) Directory

func (c *Client) Directory(ctx context.Context, limit, page int) (map[string]any, error)

Directory reads one page of the public member directory.

func (*Client) Identity

func (c *Client) Identity(ctx context.Context, identityType string) (map[string]any, error)

Identity is /agent/identity: what identity the caller can hold here.

func (*Client) Index

func (c *Client) Index(ctx context.Context) (map[string]any, error)

Index is /v1: every endpoint, and what each one costs in credentials.

func (*Client) ListDocs

func (c *Client) ListDocs(ctx context.Context) (json.RawMessage, error)

ListDocs lists every documentation page.

func (*Client) Member

func (c *Client) Member(ctx context.Context, username string) (map[string]any, error)

Member reads one public member profile.

func (*Client) ReadDoc

func (c *Client) ReadDoc(ctx context.Context, path string) (json.RawMessage, error)

ReadDoc reads one documentation page over the documentation MCP server.

func (*Client) ReadMarkdown

func (c *Client) ReadMarkdown(ctx context.Context, path string) (string, error)

ReadMarkdown reads any public page as markdown, for example "/docs/mcp".

func (*Client) SandboxTools

func (c *Client) SandboxTools(ctx context.Context) (json.RawMessage, error)

SandboxTools lists the tools on the sandbox MCP server.

func (*Client) SearchDocs

func (c *Client) SearchDocs(ctx context.Context, query string, limit int) (json.RawMessage, error)

SearchDocs searches the developer docs over the documentation MCP server.

func (*Client) Tools

func (c *Client) Tools(ctx context.Context) (json.RawMessage, error)

Tools lists the tools on the product MCP server. No credential.

type Error

type Error struct {
	Message string
	Status  int
	Code    string
	URL     string
}

Error is what every failed call returns: the HTTP status when there was one, the stable error code when the body carried one, and the URL.

func (*Error) Error

func (e *Error) Error() string

Jump to

Keyboard shortcuts

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