Documentation
¶
Overview ¶
Package mcpserver exposes the NotebookLM domain client as MCP tools.
Index ¶
- func New(d Deps, toolProfile string) *mcp.Server
- type AccountSettingsIn
- type AccountSettingsOut
- type AskManyResult
- type AudioOptions
- type AuthLoginIn
- type AuthLogoutIn
- type AuthOut
- type ChatAskIn
- type ChatAskManyIn
- type ChatAskManyOut
- type ChatAskOut
- type ChatConfigureIn
- type ChatConfigureOut
- type ChatHistoryIn
- type ChatHistoryOut
- type ChatStatusIn
- type ChatStatusOut
- type CitationOut
- type DeleteIn
- type DeleteItem
- type DeleteOut
- type Deps
- type DriveItem
- type Envelope
- type FileItem
- type FlashcardsOptions
- type ImportOutcome
- type InfographicOptions
- type JobCancelIn
- type JobCancelOut
- type JobView
- type LabelListIn
- type LabelListOut
- type LabelUpdateIn
- type LabelUpdateOut
- type NoteListIn
- type NoteListOut
- type NoteSaveIn
- type NotebookCreateIn
- type NotebookCreateOut
- type NotebookListIn
- type NotebookListOut
- type NotebookOpenIn
- type NotebookUpdateIn
- type NotebookUpdateOut
- type Progress
- type QuizOptions
- type ReportOptions
- type ResearchImportIn
- type ResearchImportOut
- type ResearchStartIn
- type ResearchStartOut
- type ResearchStatusIn
- type ResearchStatusOut
- type ServerInfoIn
- type ServerInfoOut
- type SharePartOut
- type ShareStatusIn
- type ShareUpdateIn
- type ShareUpdateOut
- type ShareUserChange
- type SlideDeckOptions
- type SourceAddIn
- type SourceAddOut
- type SourceItem
- type SourceListIn
- type SourceListOut
- type SourceOutcome
- type SourceReadIn
- type SourceReadOut
- type SourceUpdateIn
- type SourceUpdateOut
- type SourceView
- type StudioGenerateIn
- type StudioListIn
- type StudioListOut
- type SuggestIn
- type SuggestOut
- type TextItem
- type VideoOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccountSettingsIn ¶
type AccountSettingsIn struct {
OutputLanguage string `json:"output_language,omitempty" jsonschema:"language code to set, for example en or de; omit to only read"`
}
type AccountSettingsOut ¶
type AskManyResult ¶
type AskManyResult struct {
Notebook string `json:"notebook"`
NotebookID string `json:"notebook_id,omitempty"`
Status string `json:"status"` // ok|failed
Answer string `json:"answer,omitempty"`
Citations []CitationOut `json:"citations,omitempty"`
ConversationID string `json:"conversation_id,omitempty"`
Error string `json:"error,omitempty"`
Code string `json:"code,omitempty"`
}
type AudioOptions ¶ added in v0.2.0
type AudioOptions struct {
Format string `json:"format,omitempty" jsonschema:"audio format"`
Length string `json:"length,omitempty" jsonschema:"audio length"`
}
The option objects of studio_generate. Their schema enums list only the values pinned by a live capture (filled in from nlm.StudioOptions); other values the web app offers return UNSUPPORTED_BY_TRANSPORT.
type AuthLoginIn ¶
type AuthLoginIn struct {
Method string `json:"method" jsonschema:"import (cookies or file), browser or attach"`
Profile string `json:"profile,omitempty" jsonschema:"account profile name"`
Host string `json:"host,omitempty" jsonschema:"NotebookLM host, for example notebook.google.com"`
File string `json:"file,omitempty" jsonschema:"path of a cookie export file (method import)"`
}
type AuthLogoutIn ¶
type ChatAskIn ¶
type ChatAskIn struct {
Notebook string `json:"notebook" jsonschema:"notebook id, id prefix (6+ chars) or title"`
Question string `json:"question" jsonschema:"the question to ask"`
Sources []string `json:"sources,omitempty" jsonschema:"restrict the answer to these sources (id, id prefix or title); default all sources"`
ConversationID string `json:"conversation_id,omitempty" jsonschema:"continue this conversation; default is the notebook's newest thread"`
NewConversation bool `json:"new_conversation,omitempty" jsonschema:"start a fresh conversation instead of the default thread"`
Wait *bool `json:"wait,omitempty" jsonschema:"wait for the answer (default true); false returns a job_id to poll with chat_status"`
SaveAsNote bool `` /* 143-byte string literal not displayed */
}
type ChatAskManyIn ¶
type ChatAskManyIn struct {
Question string `json:"question" jsonschema:"the question to ask every notebook"`
Notebooks []string `json:"notebooks,omitempty" jsonschema:"notebook ids, id prefixes or titles"`
Tag string `json:"tag,omitempty" jsonschema:"not available yet: local tags are not implemented"`
MaxParallel int `json:"max_parallel,omitempty" jsonschema:"notebooks asked at once (default 3, max 10)"`
}
type ChatAskManyOut ¶
type ChatAskManyOut struct {
Question string `json:"question"`
Asked int `json:"asked"`
Succeeded int `json:"succeeded"`
Failed int `json:"failed"`
Results []AskManyResult `json:"results"`
}
type ChatAskOut ¶
type ChatAskOut struct {
Answer string `json:"answer,omitempty"`
Citations []CitationOut `json:"citations,omitempty"`
ConversationID string `json:"conversation_id,omitempty"`
ResponseID string `json:"response_id,omitempty"`
JobID string `json:"job_id,omitempty"`
Status string `json:"status,omitempty"`
// NoteID and NoteTitle name the note save_as_note created; NoteError
// says why it was not created (the answer is returned either way).
NoteID string `json:"note_id,omitempty"`
NoteTitle string `json:"note_title,omitempty"`
NoteError string `json:"note_error,omitempty"`
}
type ChatConfigureIn ¶
type ChatConfigureIn struct {
Notebook string `json:"notebook" jsonschema:"notebook id, id prefix (6+ chars) or title"`
Mode string `json:"mode,omitempty" jsonschema:"conversational goal; custom needs custom_prompt"`
CustomPrompt string `json:"custom_prompt,omitempty" jsonschema:"instructions for mode custom, up to 10000 characters"`
ResponseLength string `json:"response_length,omitempty" jsonschema:"response length"`
}
type ChatConfigureOut ¶
type ChatHistoryIn ¶
type ChatHistoryIn struct {
Notebook string `json:"notebook" jsonschema:"notebook id, id prefix (6+ chars) or title"`
ConversationID string `json:"conversation_id,omitempty" jsonschema:"conversation to read; default is the newest thread"`
Limit int `json:"limit,omitempty" jsonschema:"max turns per page (default 20)"`
Cursor string `json:"cursor,omitempty" jsonschema:"next_cursor of the previous page (older turns)"`
Format string `json:"format,omitempty" jsonschema:"json (default) or markdown"`
}
type ChatHistoryOut ¶
type ChatStatusIn ¶
type ChatStatusIn struct {
JobID string `json:"job_id" jsonschema:"job id returned by chat_ask with wait=false"`
}
type ChatStatusOut ¶
type CitationOut ¶
type CitationOut struct {
N int `json:"n"`
SourceID string `json:"source_id"`
SourceTitle string `json:"source_title,omitempty"`
Text string `json:"text,omitempty"`
Start int `json:"start"`
End int `json:"end"`
}
CitationOut is one cited passage. Start and End are UTF-16 code unit offsets into the answer text.
type DeleteIn ¶
type DeleteIn struct {
Kind string `json:"kind" jsonschema:"notebook, source, note, artifact, chat_history, label or collection"`
Notebook string `json:"notebook,omitempty" jsonschema:"notebook id, prefix or title; required for every kind except notebook"`
IDs []string `json:"ids" jsonschema:"ids (or exact titles) of the items to delete; for chat_history, conversation ids"`
Confirm bool `json:"confirm,omitempty" jsonschema:"must be true to delete; without it only a preview is returned"`
}
type DeleteItem ¶
type DeleteItem struct {
ID string `json:"id"`
Title string `json:"title,omitempty"`
// Conversations (kind chat_history) have no title: their times and,
// when the whole history could be read, the first question are shown.
Created time.Time `json:"created,omitzero"`
Updated time.Time `json:"updated,omitzero"`
FirstQuestion string `json:"first_question,omitempty"`
Status string `json:"status,omitempty"` // deleted | failed | unsupported (empty in a preview)
Error string `json:"error,omitempty"`
}
type DeleteOut ¶
type DeleteOut struct {
Status string `json:"status"` // preview | deleted | partial
Kind string `json:"kind"`
Items []DeleteItem `json:"items"`
Guidance string `json:"guidance,omitempty"`
}
type Deps ¶
type Deps struct {
Jobs *jobs.Table // detached work (chat_ask wait=false); nil = jobs disabled
NLM *nlm.Client
Cache *cache.Cache
Profile string // account profile name
Host session.Host
}
Deps are the server's collaborators.
type Envelope ¶
type Envelope struct {
Status string `json:"status"`
Error string `json:"error"`
Code string `json:"code"`
Retriable bool `json:"retriable"`
Guidance string `json:"guidance,omitempty"`
Suggestions []string `json:"suggestions,omitempty"`
Transport string `json:"transport,omitempty"`
// RetryAfterSeconds is Google's Retry-After, rounded up; 0 when absent.
RetryAfterSeconds int `json:"retry_after_seconds,omitzero"`
}
Envelope is the error body of every failed tool call. It is sent as the JSON text content of an IsError result, so agents can branch on Code.
type FlashcardsOptions ¶ added in v0.2.0
type ImportOutcome ¶
type InfographicOptions ¶ added in v0.2.0
type JobCancelIn ¶
type JobCancelIn struct {
JobID string `json:"job_id" jsonschema:"job id to cancel"`
}
type JobCancelOut ¶
type LabelListIn ¶
type LabelListOut ¶
type LabelUpdateIn ¶
type LabelUpdateIn struct {
Notebook string `json:"notebook" jsonschema:"notebook id, id prefix (6+ chars) or title"`
Scope string `json:"scope,omitempty" jsonschema:"source_labels (default)"`
Action string `json:"action" jsonschema:"rename, set_emoji, add_sources or remove_sources (auto and create are not available yet)"`
Label string `json:"label" jsonschema:"label id or name"`
Name string `json:"name,omitempty" jsonschema:"new name for rename"`
Emoji string `json:"emoji,omitempty" jsonschema:"emoji for set_emoji"`
Items []string `json:"items,omitempty" jsonschema:"source ids, id prefixes or titles for add_sources / remove_sources"`
}
type LabelUpdateOut ¶
type NoteListIn ¶
type NoteListOut ¶
type NoteSaveIn ¶
type NoteSaveIn struct {
Notebook string `json:"notebook" jsonschema:"notebook id, id prefix (6+ chars) or title"`
Note string `json:"note,omitempty" jsonschema:"existing note id or title to update; omit to create a new note"`
Title string `json:"title,omitempty" jsonschema:"note title"`
Content string `json:"content,omitempty" jsonschema:"note body"`
FromTurn string `json:"from_turn,omitempty" jsonschema:"save a chat turn as a note (not available yet)"`
}
type NotebookCreateIn ¶
type NotebookCreateIn struct {
Title string `json:"title" jsonschema:"title of the new notebook"`
Emoji string `json:"emoji,omitempty" jsonschema:"notebook emoji (ignored: no known wire slot yet)"`
Sources []SourceItem `json:"sources,omitempty" jsonschema:"sources to add right after creation; same items as source_add"`
}
type NotebookCreateOut ¶
type NotebookCreateOut struct {
NotebookID string `json:"notebook_id"`
Title string `json:"title,omitempty"`
Sources *SourceAddOut `json:"sources,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
type NotebookListIn ¶
type NotebookListIn struct {
Query string `json:"query,omitempty" jsonschema:"case-insensitive filter on notebook titles"`
Scope string `json:"scope,omitempty" jsonschema:"mine, shared or all (default all)"`
Limit int `json:"limit,omitempty" jsonschema:"max notebooks to return (default 20; page with offset)"`
Offset int `json:"offset,omitempty" jsonschema:"skip this many notebooks"`
Refresh bool `json:"refresh,omitempty" jsonschema:"bypass the 30 s cache"`
}
type NotebookListOut ¶
type NotebookOpenIn ¶
type NotebookOpenIn struct {
Notebook string `json:"notebook" jsonschema:"notebook id, id prefix (6+ chars) or title"`
}
type NotebookUpdateIn ¶
type NotebookUpdateIn struct {
Notebook string `json:"notebook" jsonschema:"notebook id, id prefix (6+ chars) or title"`
Title string `json:"title,omitempty" jsonschema:"new title"`
RemoveFromRecent bool `json:"remove_from_recent,omitempty" jsonschema:"drop the notebook from the recently viewed list"`
Emoji string `json:"emoji,omitempty" jsonschema:"not available yet (ignored)"`
Pinned *bool `json:"pinned,omitempty" jsonschema:"not available yet (ignored)"`
Alias string `json:"alias,omitempty" jsonschema:"not available yet (ignored)"`
Tags []string `json:"tags,omitempty" jsonschema:"not available yet (ignored)"`
}
type NotebookUpdateOut ¶
type Progress ¶
Progress reports work done so far. It is a no-op when the client sent no progress token. progress must increase on every call (MCP spec).
type QuizOptions ¶ added in v0.2.0
type ReportOptions ¶ added in v0.2.0
type ResearchImportIn ¶
type ResearchImportIn struct {
Notebook string `json:"notebook" jsonschema:"notebook id, id prefix (6+ chars) or title"`
Job string `json:"job" jsonschema:"research job id from research_start or research_status"`
URLs []string `json:"urls,omitempty" jsonschema:"URLs of the web candidates to import, as listed by research_status"`
Report bool `json:"report,omitempty" jsonschema:"also import the deep-research report candidate"`
All bool `json:"all,omitempty" jsonschema:"import every candidate"`
}
ResearchImportIn picks candidates by URL. Positions are not accepted: poll rows carry no result id and the server may reorder or add results between research_status and research_import, so an index read earlier can name a different result now.
type ResearchImportOut ¶
type ResearchImportOut struct {
Notebook string `json:"notebook"`
Added int `json:"added"`
Skipped int `json:"skipped"`
Failed int `json:"failed"`
Results []ImportOutcome `json:"results"`
}
type ResearchStartIn ¶
type ResearchStartIn struct {
Notebook string `json:"notebook" jsonschema:"notebook id, id prefix (6+ chars) or title"`
Query string `json:"query" jsonschema:"what to research; at least 4 words unless force is set"`
Mode string `json:"mode,omitempty" jsonschema:"fast (default) or deep; discover is not yet available"`
Corpus string `json:"corpus,omitempty" jsonschema:"web (default) or drive; deep supports web only"`
Force bool `json:"force,omitempty" jsonschema:"allow a query shorter than 4 words"`
}
type ResearchStartOut ¶
type ResearchStartOut struct {
Notebook string `json:"notebook"`
Job nlm.ResearchJob `json:"job"`
}
type ResearchStatusIn ¶
type ResearchStatusIn struct {
Notebook string `json:"notebook" jsonschema:"notebook id, id prefix (6+ chars) or title"`
Job string `json:"job,omitempty" jsonschema:"research job id; omit for all jobs of the notebook"`
WaitSeconds int `json:"wait_seconds,omitempty" jsonschema:"0-120: poll every 3 s until the job is done or time runs out"`
IncludeReport bool `json:"include_report,omitempty" jsonschema:"include the deep-research report text"`
}
type ResearchStatusOut ¶
type ServerInfoIn ¶
type ServerInfoIn struct {
IncludeUsage bool `json:"include_usage,omitempty" jsonschema:"also fetch account tier and quota windows (one Google call)"`
}
type ServerInfoOut ¶
type ServerInfoOut struct {
Name string `json:"name"`
Version string `json:"version"`
Profile string `json:"profile"`
Host string `json:"host"`
ToolProfile string `json:"tool_profile"`
Tools []string `json:"tools"`
LastTransport string `json:"last_transport,omitempty"`
Usage *nlm.Quota `json:"usage,omitempty"`
}
type SharePartOut ¶
type SharePartOut struct {
}
SharePartOut is the outcome of one of the two sharing calls (link setting, users) and the changes it carried.
type ShareStatusIn ¶
type ShareStatusIn struct {
}
type ShareUpdateIn ¶
type ShareUpdateIn struct {
}
type ShareUpdateOut ¶
type ShareUpdateOut struct {
}
type ShareUserChange ¶
type ShareUserChange struct {
}
type SlideDeckOptions ¶ added in v0.2.0
type SourceAddIn ¶
type SourceAddIn struct {
Notebook string `json:"notebook" jsonschema:"notebook id, id prefix (6+ chars) or title"`
Items []SourceItem `json:"items" jsonschema:"sources to add; each item sets exactly one of url, text, drive, file"`
}
type SourceAddOut ¶
type SourceItem ¶
type SourceItem struct {
URL string `json:"url,omitempty" jsonschema:"public http(s) page or YouTube video URL (YouTube is auto-detected)"`
Text *TextItem `json:"text,omitempty" jsonschema:"pasted text source"`
Drive *DriveItem `json:"drive,omitempty" jsonschema:"Google Drive document (not yet available)"`
File *FileItem `json:"file,omitempty" jsonschema:"local file upload (not yet available)"`
}
type SourceListIn ¶
type SourceListOut ¶
type SourceListOut struct {
Sources []SourceView `json:"sources"`
Total int `json:"total"`
}
type SourceOutcome ¶
type SourceReadIn ¶
type SourceReadIn struct {
Notebook string `json:"notebook" jsonschema:"notebook id, id prefix (6+ chars) or title"`
Source string `json:"source" jsonschema:"source id, id prefix or title"`
Mode string `json:"mode,omitempty" jsonschema:"fulltext (default), markdown, or guide (the source guide: summary as text plus keywords)"`
Offset int `json:"offset,omitempty" jsonschema:"character offset to start from"`
MaxChars int `json:"max_chars,omitempty" jsonschema:"max characters to return (default 20000, cap 200000)"`
}
type SourceReadOut ¶
type SourceReadOut struct {
SourceID string `json:"source_id"`
Text string `json:"text"`
Offset int `json:"offset"`
TotalChars int `json:"total_chars"`
Truncated bool `json:"truncated"`
NextOffset int `json:"next_offset,omitempty"`
// Keywords is set in mode guide only; Text is then the guide's summary.
Keywords []string `json:"keywords,omitempty"`
}
type SourceUpdateIn ¶
type SourceUpdateIn struct {
Notebook string `json:"notebook" jsonschema:"notebook id, id prefix (6+ chars) or title"`
Source string `json:"source" jsonschema:"source id, id prefix or title"`
Title string `json:"title,omitempty" jsonschema:"new title"`
Refresh bool `json:"refresh,omitempty" jsonschema:"re-fetch the source (not yet available)"`
CheckFreshness bool `json:"check_freshness,omitempty" jsonschema:"report whether the source is up to date"`
}
type SourceUpdateOut ¶
type SourceView ¶
type StudioGenerateIn ¶
type StudioGenerateIn struct {
Notebook string `json:"notebook" jsonschema:"notebook id, id prefix (6+ chars) or title"`
Kind string `json:"kind" jsonschema:"the artifact kind"`
Sources []string `` /* 126-byte string literal not displayed */
Instructions string `` /* 252-byte string literal not displayed */
Language string `json:"language,omitempty" jsonschema:"output language code as the web app sends it (default en; cinematic video takes none)"`
Audio *AudioOptions `json:"audio,omitempty" jsonschema:"options for kind audio"`
Video *VideoOptions `json:"video,omitempty" jsonschema:"options for kind video"`
Report *ReportOptions `json:"report,omitempty" jsonschema:"options for kind report (required)"`
SlideDeck *SlideDeckOptions `json:"slide_deck,omitempty" jsonschema:"options for kind slide_deck"`
Quiz *QuizOptions `json:"quiz,omitempty" jsonschema:"options for kind quiz"`
Flashcards *FlashcardsOptions `json:"flashcards,omitempty" jsonschema:"options for kind flashcards"`
Infographic *InfographicOptions `json:"infographic,omitempty" jsonschema:"options for kind infographic"`
}
type StudioListIn ¶
type StudioListIn struct {
Notebook string `json:"notebook" jsonschema:"notebook id, id prefix (6+ chars) or title"`
Artifact string `json:"artifact,omitempty" jsonschema:"one artifact id or title; returns it with its interactive content when available"`
Kind string `` /* 184-byte string literal not displayed */
Status string `json:"status,omitempty" jsonschema:"filter by status: pending (queued or generating), ready or failed"`
}
type StudioListOut ¶
type StudioListOut struct {
Artifacts []nlm.Artifact `json:"artifacts"`
Total int `json:"total"`
Content *nlm.ArtifactContent `json:"content,omitempty"`
}
type SuggestIn ¶
type SuggestIn struct {
Notebook string `json:"notebook,omitempty" jsonschema:"notebook id, id prefix or title (not needed for studio_options)"`
Surface string `json:"surface" jsonschema:"chat, followups, report or studio_options"`
Sources []string `json:"sources,omitempty" jsonschema:"limit to these sources (id, id prefix or title)"`
Query string `json:"query,omitempty" jsonschema:"steer chat suggestions toward this topic"`
}
type SuggestOut ¶
type SuggestOut struct {
Suggestions []nlm.Suggestion `json:"suggestions"`
}