server

package
v0.7.114 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: MIT Imports: 42 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package server is the MCP server and its tool registry, shared by every transport.

Index

Constants

View Source
const (
	DatasetEnv        = "WOWC_DATASET"
	SavedVariablesEnv = "WOWC_SAVEDVARIABLES"
)
View Source
const (
	SVFlag = "flag"
	SVEnv  = "env"
	SVAuto = "auto"
)

Where SavedVariables came from.

View Source
const DefaultDungeonLimit = 3

DefaultDungeonLimit is how many ranked dungeons dungeon_plan lists when none is asked for.

View Source
const DefaultFarmLimit = 5

DefaultFarmLimit is how many spots farm_spots lists when none is asked for.

View Source
const DefaultLimit = 8

DefaultLimit is how many steps whats_next returns when none is asked for.

View Source
const DefaultUpgradeLimit = 3

DefaultUpgradeLimit is how many upgrades per slot upgrade_finder returns when none is asked for.

View Source
const MaxPlanText = 20

MaxPlanText is how many stops quest_plan's text lists; the plan itself holds them all.

Variables

View Source
var Version = "dev"

Version is the advisor's version. Release builds set it from main at link time.

Functions

func CaptureClient

func CaptureClient(path string) character.Client

CaptureClient is the game client that wrote the capture at path, empty when it cannot be read.

func Diagnose

func Diagnose(cfg Config) doctor.Report

Diagnose checks the whole setup for the configured SavedVariables file.

func EnsureDataFiles added in v0.7.0

func EnsureDataFiles(cfg Config) error

EnsureDataFiles writes a valid empty stub for each of Digest.lua and Plan.lua that is missing from the installed slot addon, so the game never lists a file that isn't there. It does nothing when the addon folder is absent, and never touches a file that exists. The error is the first write failure.

func HTTPHandler

func HTTPHandler(s *mcp.Server) http.Handler

HTTPHandler serves streamable HTTP; mount it at /mcp.

func New

func New(cfg Config) *mcp.Server

New builds the server with its tools. The character file is read on every call.

func NotCapturedError

func NotCapturedError(name string) error

NotCapturedError is what a digest asked for an uncaptured character says.

func ProfessionCoverage added in v0.7.98

func ProfessionCoverage(cfg Config) (string, error)

ProfessionCoverage is the "doctor professions" report: for each captured character and each of their professions, whether recipes were captured and what the dataset holds (recipes, trainers, recipe vendors, recipe sources).

func QuestCoverage added in v0.7.94

func QuestCoverage(cfg Config) (string, error)

QuestCoverage is the "doctor quests" report: for each captured character with quests in the log, how many objectives are placed from Questie, from the game's quest map points, approximately, or not at all.

func SavedNote added in v0.7.35

func SavedNote(spec string) string

SavedNote is the line that ends an answer after set_character_profile succeeded.

func ServeStdio

func ServeStdio(ctx context.Context, s *mcp.Server) error

ServeStdio serves over stdin and stdout until the client disconnects.

Types

type BagsInput added in v0.7.44

type BagsInput struct {
	Mode      string `` /* 168-byte string literal not displayed */
	Item      string `json:"item,omitempty" jsonschema:"for find: the item name, such as Linen Cloth"`
	Character string `json:"character,omitempty" jsonschema:"for mail: the character the items would go to"`
}

BagsInput is the bags_across_characters argument.

type BagsOutput added in v0.7.44

type BagsOutput struct {
	Mode         string            `json:"mode"`
	Lines        []inventory.Line  `` /* 126-byte string literal not displayed */
	Found        []inventory.Found `json:"found,omitempty" jsonschema:"find: each matching item with who holds it"`
	SellValue    *int64            `json:"sell_value_copper" jsonschema:"copper the priced vendor stacks sell for; null when no price is known"`
	SellUnpriced int               `json:"sell_unpriced" jsonschema:"vendor stacks with no known price"`
	SlotsFreed   int               `json:"bag_slots_freed"`
	Notes        []string          `json:"notes"`
	Text         string            `json:"text" jsonschema:"plain-text rendering"`
}

BagsOutput is the bags_across_characters result.

type BriefInput

type BriefInput struct {
	Character string `json:"character,omitempty" jsonschema:"character name; omit when only one was captured"`
}

BriefInput is the character_brief argument.

type ChainInput

type ChainInput struct {
	Quest string `json:"quest" jsonschema:"quest id or name"`
}

ChainInput is the quest_chain argument.

type ChainOutput

type ChainOutput struct {
	Quest string       `json:"quest" jsonschema:"quest name, empty when the dataset has none"`
	Chain quests.Chain `json:"chain"`
	Text  string       `json:"text" jsonschema:"plain-text rendering"`
}

ChainOutput is the quest_chain result.

type ClientInfo

type ClientInfo struct {
	Version string `json:"version"`
	Build   string `json:"build"`
	TOC     string `json:"toc"`
}

ClientInfo is the game client a capture was written by.

type Config

type Config struct {
	Dataset        string
	SavedVariables string
	DigestPath     string // the digest file to write; empty derives it from SavedVariables
	SkipUnchanged  bool   // leave the file alone when only the generated times would differ
	Cache          string // dataset cache directory for doctor; empty is the per-user cache

	Profiles string // the play-style store; empty is profile.Path()

	// SVSource says where SavedVariables came from once FromEnv has run: SVFlag, SVEnv or SVAuto.
	SVSource string
	// SVNote is the one line telling which file auto-detect picked; empty otherwise.
	SVNote string

	// PendingBuild is the game build whose dataset is not downloaded yet, with the reason; the
	// digest's dataset note says so. PendingPublished is true when a release is known to exist.
	PendingBuild     string
	PendingReason    string
	PendingPublished bool
}

Config says where the dataset and the character file are; empty means none. Empty fields fall back to the environment (see FromEnv).

func (Config) FromEnv

func (c Config) FromEnv() Config

FromEnv fills empty fields from $WOWC_DATASET and $WOWC_SAVEDVARIABLES. An empty SavedVariables that the environment leaves empty is searched for in the standard WoW install folders; an explicit flag or variable always wins.

type DigestInput

type DigestInput struct {
	Character string `` /* 133-byte string literal not displayed */
}

DigestInput is the update_digest argument.

type DigestOutput

type DigestOutput struct {
	Characters []string                  `json:"characters" jsonschema:"the characters written, most recently captured first"`
	Skipped    []string                  `json:"skipped,omitempty" jsonschema:"captured characters left out: past the 30 most recent, or a repeated name"`
	Path       string                    `json:"path" jsonschema:"the Digest.lua file written"`
	Lines      map[string]map[string]int `json:"lines" jsonschema:"lines written, per character and section id"`
	Text       string                    `json:"text" jsonschema:"plain-text summary, with the /reload reminder"`
	Unchanged  bool                      `json:"unchanged,omitempty" jsonschema:"the file already held this digest and was not rewritten"`
	PlanPath   string                    `json:"plan_path,omitempty" jsonschema:"the Plan.lua file written beside it: the quest route per character"`
}

DigestOutput is the update_digest result.

func WriteDigest

func WriteDigest(cfg Config, name string) (DigestOutput, error)

WriteDigest builds the digest of every captured character (at most digest.MaxCharacters, the most recently captured first) and writes it atomically to the slot addon. A non-empty name must be among the captured characters, or nothing is written. The slot addon must already be installed; nothing is created.

type DungeonInput

type DungeonInput struct {
	Character string `json:"character,omitempty" jsonschema:"character name; omit when only one was captured"`
	Limit     int    `json:"limit,omitempty" jsonschema:"how many ranked dungeons to list (default 3, or 2 with brief)"`
	Brief     bool   `json:"brief,omitempty" jsonschema:"compact answer: the text rendering only, not the same data again as fields"`
	Dungeon   string `` /* 176-byte string literal not displayed */
}

DungeonInput is the dungeon_plan argument.

type DungeonOutput

type DungeonOutput struct {
	Character string                 `json:"character"`
	Picks     []dungeons.DungeonPick `json:"picks"`
	Unknown   []dungeons.DungeonPick `json:"level_unknown"`
	Text      string                 `json:"text" jsonschema:"plain-text rendering"`
}

DungeonOutput is the dungeon_plan result.

type FarmInput

type FarmInput struct {
	Character string `json:"character,omitempty" jsonschema:"character name; omit when only one was captured"`
	Item      string `json:"item" jsonschema:"item id or name"`
	Limit     int    `json:"limit,omitempty" jsonschema:"how many spots to list (default 5)"`
}

FarmInput is the farm_spots argument.

type FarmOutput

type FarmOutput struct {
	Character string      `json:"character"`
	ItemID    int64       `json:"item_id"`
	Item      string      `json:"item"`
	Spots     []farm.Spot `json:"spots"`
	Crafted   bool        `json:"crafted" jsonschema:"the item can also be crafted; see profession_plan"`
	Text      string      `json:"text" jsonschema:"plain-text rendering"`
}

FarmOutput is the farm_spots result.

type FindVendorInput added in v0.7.98

type FindVendorInput struct {
	Character string `json:"character,omitempty" jsonschema:"character name; omit when only one was captured"`
	Query     string `` /* 195-byte string literal not displayed */
	Zone      string `json:"zone,omitempty" jsonschema:"a zone or subzone to look in (Booty Bay, Stranglethorn Vale); omit to look everywhere"`
	Here      bool   `json:"here,omitempty" jsonschema:"true for 'here' or 'near me': look in the character's current place"`
	Kind      string `json:"kind,omitempty" jsonschema:"vendor (default), trainer or flight (flight masters)"`
}

FindVendorInput is the find_vendor argument.

type GatherInput added in v0.7.38

type GatherInput struct {
	Character string `json:"character,omitempty" jsonschema:"character name; omit when only one was captured"`
	Item      string `` /* 153-byte string literal not displayed */
	Kind      string `json:"kind,omitempty" jsonschema:"mine, herb or fish: narrows an item search, and says which skill a level answer is for"`
}

GatherInput is the where_to_gather argument.

type Info

type Info struct {
	Version              string      `json:"version"`
	Dataset              string      `json:"dataset" jsonschema:"dataset status"`
	DatasetPath          *string     `json:"dataset_path"`
	ManifestVersion      *string     `json:"manifest_version"`
	GameBuild            *string     `json:"game_build"`
	DatasetMatchesClient *bool       `json:"dataset_matches_client" jsonschema:"dataset build equals the capture's client build"`
	DatasetWarning       *string     `json:"dataset_warning"`
	SavedVariables       string      `json:"savedvariables" jsonschema:"character file status"`
	SavedVariablesPath   *string     `json:"savedvariables_path"`
	Characters           *int        `json:"characters"`
	CharactersCapturedAt *string     `json:"characters_captured_at"`
	Client               *ClientInfo `json:"client" jsonschema:"game client that wrote the capture"`
}

Info is the server_info result.

func Describe

func Describe(cfg Config) Info

Describe reports on this server, the dataset it found and the character file it was given.

type InventoryInput

type InventoryInput struct {
	Character string `json:"character,omitempty" jsonschema:"character name; omit when only one was captured"`
}

InventoryInput is the inventory_review argument.

type InventoryOutput

type InventoryOutput struct {
	Character      string                       `json:"character"`
	Groups         map[string][]inventory.Entry `json:"groups" jsonschema:"stacks per group: equip, keep, quest, vendor, bank, unknown"`
	VendorValue    *int64                       `json:"vendor_value_copper" jsonschema:"copper the priced vendor stacks sell for; null when no price is known"`
	VendorUnpriced int                          `json:"vendor_unpriced" jsonschema:"vendor stacks with no known price"`
	SlotsFreed     int                          `json:"bag_slots_freed"`
	Notes          []string                     `json:"notes"`
	Text           string                       `json:"text" jsonschema:"plain-text rendering"`
}

InventoryOutput is the inventory_review result.

type LearnInput added in v0.7.37

type LearnInput struct {
	Character string `json:"character,omitempty" jsonschema:"character name; omit when only one was captured"`
	Recipe    string `` /* 184-byte string literal not displayed */
}

LearnInput is the where_to_learn argument.

type LearnOutput added in v0.7.37

type LearnOutput struct {
	learn.Result
	Counts map[string]int `json:"trainer_recipes_without_a_skill_number,omitempty"`
}

LearnOutput is the where_to_learn result.

type ListOutput

type ListOutput struct {
	Characters []brief.Entry `json:"characters"`
}

ListOutput is the list_characters result.

type NextInput

type NextInput struct {
	Character string `json:"character,omitempty" jsonschema:"character name; omit when only one was captured"`
	Limit     int    `json:"limit,omitempty" jsonschema:"most steps to return (default 8)"`
}

NextInput is the whats_next argument.

type NextOutput

type NextOutput struct {
	Character string        `json:"character"`
	Steps     []advice.Step `json:"steps"`
	Total     int           `json:"total" jsonschema:"steps before the limit"`
	Text      string        `json:"text" jsonschema:"plain-text rendering of the steps"`
}

NextOutput is the whats_next result.

type PathsInput added in v0.7.10

type PathsInput struct {
	Character string `json:"character,omitempty" jsonschema:"character name; omit when only one was captured"`
	Item      string `json:"item,omitempty" jsonschema:"item name, exact or part of it; give this or slot"`
	Slot      string `` /* 218-byte string literal not displayed */
}

PathsInput is the upgrade_paths argument: an item, or a slot.

type PathsOutput added in v0.7.10

type PathsOutput struct {
	Character string         `json:"character"`
	Results   []paths.Result `json:"results" jsonschema:"one per item, each with its ways to get it, best first"`
	Text      string         `json:"text" jsonschema:"plain-words rendering"`
}

PathsOutput is the upgrade_paths result: names only, never ids.

type PlanInput

type PlanInput struct {
	Character   string `json:"character,omitempty" jsonschema:"character name; omit when only one was captured"`
	Profession  string `json:"profession,omitempty" jsonschema:"one profession (for example Tailoring); omit for all the character's professions"`
	TargetSkill int    `json:"target_skill,omitempty" jsonschema:"skill to plan up to; default is the highest tier cap the character's level allows"`
	Part        int    `json:"part,omitempty" jsonschema:"which part of a long path to show (1 is the default; each part holds about 8 bands)"`
	Pairings    bool   `json:"pairings,omitempty" jsonschema:"true for 'which professions should I pick?': pairing advice instead of a path"`
}

PlanInput is the profession_plan argument.

type PlanOutput

type PlanOutput struct {
	Character string                 `json:"character"`
	Plans     []professions.Leveling `json:"plans"`
	Paths     []professions.Path     `json:"paths,omitempty" jsonschema:"computed skill-up paths, one per profession"`
	Pairings  []professions.Advice   `json:"pairings,omitempty"`
	Text      string                 `json:"text" jsonschema:"plain-text rendering"`
}

PlanOutput is the profession_plan result.

type ProfileInput added in v0.7.0

type ProfileInput struct {
	Character string   `json:"character,omitempty" jsonschema:"character name; omit when only one was captured"`
	Role      string   `json:"role,omitempty" jsonschema:"damage, tank, healer or balanced; required the first time"`
	Focus     string   `json:"focus,omitempty" jsonschema:"leveling, dungeons, pvp or mixed; required the first time"`
	Spec      string   `json:"spec,omitempty" jsonschema:"the spec tree the player chose, for example Fury"`
	StatPref  string   `` /* 129-byte string literal not displayed */
	Clear     []string `` /* 229-byte string literal not displayed */
}

ProfileInput is the set_character_profile argument.

type ProfileOutput added in v0.7.0

type ProfileOutput struct {
	Character    string             `json:"character"`
	Profile      *character.Profile `json:"profile"`
	NeedsProfile bool               `json:"needs_profile" jsonschema:"no play style is saved: ask the player first"`
	Text         string             `json:"text" jsonschema:"plain-text rendering"`
	SavedNote    string             `json:"saved_note,omitempty" jsonschema:"set only after a save: the line the player sees at the end of the answer"`
}

ProfileOutput is the get_character_profile and set_character_profile result.

type RouteOutput added in v0.6.0

type RouteOutput struct {
	Plan route.Plan `json:"plan"`
	Text string     `json:"text" jsonschema:"plain-text route"`
}

RouteOutput is the quest_plan result.

type SeasonalInput added in v0.7.84

type SeasonalInput struct {
	Character string `json:"character,omitempty" jsonschema:"character name; omit when only one was captured"`
	Set       string `` /* 314-byte string literal not displayed */
	Event     string `json:"event,omitempty" jsonschema:"limit set to one event, such as Midsummer; omit for every event"`
}

SeasonalInput is the seasonal_events argument.

type SeasonalOutput added in v0.7.84

type SeasonalOutput struct {
	Character string `json:"character"`
	Setting   string `json:"setting" jsonschema:"off, on, or on for the named events"`
	Changed   bool   `json:"changed"`
	Text      string `` /* 128-byte string literal not displayed */
	SavedNote string `json:"saved_note,omitempty" jsonschema:"set only after a change: say it in one sentence"`
}

SeasonalOutput is the seasonal_events result.

type StatCheckInput added in v0.7.12

type StatCheckInput struct {
	Character string `json:"character,omitempty" jsonschema:"character name; omit when only one was captured"`
}

StatCheckInput is the stat_check argument.

type StatCheckOutput added in v0.7.12

type StatCheckOutput struct {
	Character string `json:"character"`
	stats.Result
	Text string `json:"text" jsonschema:"the insights in plain words; with needs=play_style, the choices to offer"`
}

StatCheckOutput is the stat_check result.

type TalentInput

type TalentInput struct {
	Character string `json:"character,omitempty" jsonschema:"character name; omit when only one was captured"`
	Spec      string `` /* 128-byte string literal not displayed */
	Limit     int    `json:"limit,omitempty" jsonschema:"how many points to list (default 5)"`
}

TalentInput is the talent_plan argument.

type TalentOutput

type TalentOutput struct {
	Character string         `json:"character"`
	Plan      talents.Result `json:"plan"`
	Text      string         `json:"text" jsonschema:"plain-text rendering"`
}

TalentOutput is the talent_plan result.

type TravelRouteInput added in v0.7.113

type TravelRouteInput struct {
	Character string `json:"character,omitempty" jsonschema:"character name; omit when only one was captured"`
	From      string `json:"from,omitempty" jsonschema:"where the trip starts: a zone, town or flight point; omit for the character's position"`
	To        string `json:"to" jsonschema:"where the trip ends: a zone, town, flight point, or an NPC or quest giver by name"`
}

TravelRouteInput is the travel_route argument.

type TravelRouteOutput added in v0.7.113

type TravelRouteOutput struct {
	route.TravelRoute
	Text string `json:"text" jsonschema:"the route in words, to answer from"`
}

TravelRouteOutput is the travel_route result.

type TreeInput added in v0.7.0

type TreeInput struct {
	Character string `json:"character,omitempty" jsonschema:"character name; omit when only one was captured"`
}

TreeInput is the talent_tree argument.

type TreeOutput added in v0.7.0

type TreeOutput struct {
	Character string `json:"character"`
	Text      string `json:"text" jsonschema:"plain-text rendering"`
}

TreeOutput is the talent_tree result.

type UpgradeInput

type UpgradeInput struct {
	Character string `json:"character,omitempty" jsonschema:"character name; omit when only one was captured"`
	Slot      string `` /* 191-byte string literal not displayed */
	Limit     int    `json:"limit,omitempty" jsonschema:"most upgrades per slot (default 3, or 1 with brief)"`
	Brief     bool   `json:"brief,omitempty" jsonschema:"compact answer: the text rendering only, one upgrade per slot unless limit is set"`
}

UpgradeInput is the upgrade_finder argument.

type UpgradeOutput

type UpgradeOutput struct {
	Character     string                      `json:"character"`
	Spec          string                      `json:"spec,omitempty" jsonschema:"spec the stat weights are for; empty when none apply"`
	ItemLevelOnly bool                        `json:"item_level_only" jsonschema:"true when upgrades are ranked by item level alone"`
	Slots         map[string][]gear.Candidate `json:"slots"`
	Text          string                      `json:"text" jsonschema:"plain-text rendering"`
}

UpgradeOutput is the upgrade_finder result.

Jump to

Keyboard shortcuts

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