retrieve_context
Retrieve Context
START HERE for a question about PostgreSQL. Searches every mailing list (inbox narrows it) with hybrid keyword + semantic ranking and returns cited passages that fit token_budget (default 4000, max 32000): one passage per thread, each the author's own words (quotes, signature and patch removed, cut at ~1200 chars) with url, inbox, message_id, from and date. found=false with a reason when the archive does not appear to discuss the question, instead of weak matches. Retrieval only: write the answer yourself. Cite each claim with its passage url or https://postgr.es/m/<message_id>; open a thread with get_thread. author, since and until restrict it to what one person wrote in a date window (filter echoes them).
输入参数inboxsinceuntilauthorquestion必填token_budget
commit_buildfarm_status
Commit Buildfarm Status
Buildfarm results for one PostgreSQL commit: every animal that built it, with branch, status (passed/failed/flapping), the failing stage and the log url, plus a {passed, failed, flapping, unknown} rollup. commit_sha is a SHA (>= 7 hex) or a branch, tag or major version (17, 9.6) for the commit it points at. Cite the commit SHA and the log urls.
输入参数commit_sha必填
commit_history
Commit History
Everything linked to one commit: subject, author and date with its sha, the mail thread its Discussion: link names (participants resolved to people and organizations), the commitfest entry if tracked, and Discord mentions. For postgres also first_releases (per branch the change landed on: branch, sha, release e.g. 14.23 or null when unreleased, first_version incl. betas, shipped=false when it was reverted before that release), reverted_by (the commits that revert it, each with its own reverted_by) and reverts, read from git tags and commit messages, never guessed. commit_id takes a SHA (>= 7 hex), branch, tag, major version (17, 9.6), <ref>~N or a commit_id from another tool; repository defaults to postgres. The diff itself is not included (git_diff, or git_show_file for one file). Cite the sha and the thread's https://postgr.es/m/<message_id>.
输入参数commit_id必填
find_failing_patches
Find Failing Patches
Commitfest entries whose latest cfbot build fails on at least one platform: cf_id, title, entry_status and commitfest_number. entry_status filters (default the active reviewable statuses, e.g. needs-review, ready-for-committer); platform narrows to one CI platform; limit caps the list. Cite https://commitfest.postgresql.org/patch/<cf_id>/.
输入参数limitplatformentry_status
get_attachment
Get Attachment
The content of one attachment of a mail message (a patch, a log, a test case), chosen by 1-based index or a filename substring, as listed in get_message/get_thread attachments. Text attachments come back as decoded text (a .patch is ready to read or `git apply`), binary ones as base64 with encoding=base64; size is the decoded byte count. Cite the message as https://postgr.es/m/<message_id>.
输入参数inboxindexfilenamemessage_id必填
Reverse call graph: the symbols that call or reference qualified_name (from search_symbols), each with its file and lines, like `git grep -w <name>` restricted to call sites. HEAD only; macro expansion and function pointers are not followed. limit caps the list. Read a caller with git_show_file at its line.
输入参数limitrepositoryqualified_name必填
get_contributor
Get Contributor
A contributor's profile by email (exact) or name (substring): canonical name, page hash, totals and per-release counts by role (authored, reviewed, committed, reported, ...), the 5 latest credited commits with sha, and buildfarm animals they own. People who hid their page are excluded from name lookups. For what they did recently use whats_new. Cite https://pg.ddx.io/community/<hash>.
输入参数nameemail
One PostgreSQL documentation page as text: path (e.g. "brin.html" or "sql-createtable.html") and optional version ("17", "current"; default the latest). Returns its url, path and stored text (body) with fetched_at. Use search_docs to find the path. Cite the returned url.
输入参数path必填version
One commitfest entry by cf_id (the number in commitfest.postgresql.org/patch/<cf_id>/): title, status, commitfest, authors, reviewers, committer, its mail threads and branches. Read the thread with get_thread; cfbot state with find_failing_patches. Cite https://commitfest.postgresql.org/patch/<cf_id>/.
输入参数cf_id必填
One mail message by Message-ID: headers, in_reply_to/references, decoded body text (by default the author's own words: quotes, signature and inline patch removed; full_text=true for everything, quotes included), attachments [{index, filename, content_type, size}] and has_patch. Never raw MIME: get_attachment returns an attachment's content, get_raw_message the RFC 822 source. Finds the list itself unless inbox is given. Cite as https://postgr.es/m/<message_id>.
输入参数inboxbody_onlyfull_textmessage_id必填include_body
A mail thread, found by any Message-ID in it, oldest first. Each message: from, to, cc, date, message_id, decoded body text (by default the author's own words: quoted replies, signature and inline patch removed; full_text=true for the whole decoded text; never raw MIME), attachments [{index, filename, content_type, size}] and has_patch. Paged: 20 messages per call (limit max 500; offset/next_offset/has_more); bodies capped at max_body_chars (default 4000; 0 = no cap; body_truncated marks a cut). include_bodies=false gives a cheap outline. Finds the list itself unless inbox is given. Cite as https://postgr.es/m/<message_id>.
输入参数inboxlimitoffsetfull_textmessage_id必填include_bodiesmax_body_chars
get_wiki_page
Get Wiki Page
One wiki.postgresql.org page by title: its latest revision content with author and date. Titles are as on the wiki ("Don't Do This", "Todo"). Use search_wiki to find a title, get_wiki_history for older revisions. Cite https://wiki.postgresql.org/wiki/<title>.
输入参数title必填
Commit history like `git log`, newest first, filtered by path (commits touching a file), author (substring), since/until (YYYY-MM-DD or RFC 3339) and branch (any branch, tag or major version such as 17 or 9.6; default the indexed default branch). Each commit: sha (40-hex, cite it), commit_id, message (subject for a branch log), author and dates. limit default 50, max 200; offset pages; has_more. repository defaults to postgres.
输入参数pathlimitsinceuntilauthorbranchoffsetrepository
Search postgres commit messages (or file paths with search_in=paths) by keywords, newest first (all words must appear, case-insensitive; like `git log -i --grep` with every word). Each commit: sha (40-hex, cite it), commit_id, message, author, date, people credited, and mail_refs: up to 5 messages that refer to it {inbox, message_id, subject, url, how_it_refers: discussion-trailer, committers-announcement or mentions-hash}. repository defaults to postgres; limit default 50, max 200. Details with commit_history.
输入参数limitquery必填search_inrepository
hybrid_search
Hybrid Search
Mailing-list search, keyword (BM25 over the authors' own words) and semantic (embeddings) blended per thread, over every list unless inbox names one or more. Returns up to limit threads (default 20, max 50), best first, each its best message: inbox, message_id, subject, from, date, thread_id, fused_score (0-1), similarity and a short excerpt of the author's own words. Like a ranked `git log --grep` for mail. Cite as https://postgr.es/m/<message_id>; read with get_thread or get_message (inbox from the result). author, since and until restrict both arms to one sender and a date window.
输入参数inboxlimitquery必填sinceuntilauthorkeyword_weight
Every source behind this server with its kind (inbox, repository, docs, wiki, discord), item count, last update and freshness (fresh/stale): the 56 mailing lists, the git repositories, the documentation releases, the wiki and Discord. Use it to learn the inbox and repository names other tools accept and how current each is. kind filters; min_items drops small sources.
输入参数kindlimitoffsetmin_items
search_commitfest
Search Commitfest
Full-text search of commitfest entries (title first, then author/reviewer/committer names), in the current commitfest by default, or commitfests="all" (back to 2014) or a comma list of numbers. Websearch syntax: "phrase", -term, or. Each result: cf_id, title, status, commitfest(s), people, last update, the commitfest.postgresql.org patch url and the pg.ddx.io thread link. limit default 20, max 50. Details with get_entry; cite the patch url.
输入参数limitquery必填commitfests
Keyword search of mailing-list messages (BM25 over subject, sender and the authors' own words), every list unless inbox narrows it. Operators in query: s:/intitle: subject, f:/from: sender, b:/intext: body, after:/before:/d:2024-01..2025-01 dates, site:<list>, filetype:patch, link:<url glob>, /regex/. Returns messages best first (limit default 50, max 200; offset pages; collapse_threads=true keeps one per thread), each with inbox, message_id, subject, from, date, thread_id and an excerpt, plus total and has_more. Use it for exact words, names and identifiers; hybrid_search for questions. Cite as https://postgr.es/m/<message_id>. author, since and until restrict it to one sender and a date window.
输入参数inboxlimitquery必填sinceuntilauthoroffsetcollapse_threads
Full-text search of the PostgreSQL documentation (websearch syntax: "phrase", -term, or), title matches first. Searches the current release unless version (one, e.g. "17") or versions (several) is given; a page matching in several selected versions is one result listing each version and its URL. Returns title, path, url, the versions it matched and a snippet. Read a page with get_doc_page; cite its postgresql.org/docs url.
输入参数limitquery必填versionversions
search_symbols
Search Symbols
Find C functions, macros, types and variables by name in the indexed source (HEAD): BM25 on names, then fuzzy and body matches. Filter by kind (function, struct, macro, ...), language, repository. Each result: qualified_name, name, kind, language, file, start_line and end_line. Like `ctags`/`git grep -w` for definitions. Follow with get_callers, or git_show_file with start_line/end_line to read the body.
输入参数kindlimitquery必填languagerepository
Full-text search (websearch syntax) of wiki.postgresql.org. By default searches each page's current text; history=true searches every revision and returns, per page, the latest matching revision (rev_id, revision_url, author, comment, timestamp, is_current) and how many matched; since/until bound the revision dates. Read a page with get_wiki_page; cite its wiki url.
输入参数limitquery必填sinceuntilhistory
cross_reference
Cross Reference
What relates to one stored item, and what happened to it. ref: a Message-ID or message URL, a commit SHA or URL, a docs URL or page.html, a wiki URL or title, a commitfest URL, CVE-YYYY-NNNNN, or feature:<words> (matched to commitfest titles; ref.entries_used says which). Returns related threads, commits (with releases and reverted_by), docs, wiki pages, commitfest entries and people, each with why, strongest first: explicit links, shared identifiers, then similar topic. For a postgres commit, thread, entry or feature, timeline says which release shipped it and whether it was reverted or back-patched: status plus dated events (first post, commitfest listings, commits with branch and first release, reverts), each with its source url. kinds narrows; limit_per_kind (default 5, max 25). ~3 s budget: late parts go in timed_out. Same as GET /api/v2/related.
输入参数ref必填kindsversiontimelinelimit_per_kind
Catch up: everything a person or group did, and where they were named, in a window, newest first per kind (mail grouped by thread). who: a name (fuzzy; close matches return ambiguous [{name, hash}]), email, hash:<8 hex>, team:<slug>, org:<name>, new:<window>, a phrase ('the core team'), or a list. since/until: ISO date, today, 2w/14d/1m, pg19 (a release's development window), all; default 14 days. during: a calendar event uid/url. topic narrows by hybrid search. Kinds: waiting (one person, no topic: what is on their radar, each with group, priority 0-100 and why), mail_from, mail_to_cc, mail_mention, git_author, git_credit, git_mention, wiki_edit, wiki_mention, commitfest, calendar, roster. Names, page hashes and urls only, never addresses. ~4 s budget; late kinds go in timed_out with partial=true. Cite each item's url. Same as GET /api/v2/activity.
输入参数who必填kindslimitsincetopicuntilduring
Search the postgres source at any commit, branch, tag or date (or across history), from the code-history index: every line of every commit, byte-exact. A literal by default; match=regex for a PostgreSQL regex (^ and $ are per line; \b \< \> as in grep), match=identifier for any of snake_case/CamelCase/UPPER spellings. File sets agree with `git grep -l` at the same commit. Results name the resolved sha and ref. complete=false means the totals are lower bounds (cut says why). With history (all | <rev> | A..B) it returns every matching line any commit in the range had, with the commit that added it and the one that removed it.
输入参数limitmatchpathsquery必填offsetoutputcontextexcludehistoryincludeversionbudget_ms另有 2 个
Read a file of the postgres source at any commit, branch, tag or date from the code-history index: numbered lines, at most 2000 per call (page with start_line/end_line), byte-exact to git. Says total_lines and complete; binary files return their metadata only.
输入参数path必填versionend_linerepositorystart_line
List the files of the postgres source under a directory at any commit, branch, tag or date (code-history index), with line counts; depth folds deeper paths into directories with file counts; glob filters paths.
输入参数globpathdepthlimitversionrepository
Per-line blame of a postgres file at any commit (code-history index): the commit that wrote each line, as `git blame` with git's default diff. ignore_revs (default true) passes through the pgindent/reformat commits of .git-blame-ignore-revs when they replaced lines one-for-one; reverse adds the commit that removed each line later on the version's branch. At most 2000 lines per call; commits lists author, date and subject per short sha. Not the same as git_blame, which returns a file's commit history.
输入参数path必填reverseversionend_linerepositorystart_lineignore_revs
One postgres commit from the code-history index: message, parsed trailers (names only), Discussion threads (links to the archived thread on /m/), back-patch siblings on other branches, first_releases (per branch the change landed on: sha, release such as 14.23, first_version incl. betas, shipped=false when reverted before that release; null release = not yet released), reverted_by and reverts, files changed with line counts, and its diff rendered from the index (at most 3000 lines; diff_complete says whether it was cut). Accepts a SHA (7+ hex), branch, tag or any version form.
输入参数diffpathscommit必填contextrepository
search_commits
Search Commits
Search postgres commits (code-history index), newest first, like git log: range (a rev, or A..B; default the newest release branch), message (regex, case-insensitive), author (regex over author, committer and Author/Co-authored-by/Reviewed-by trailers), paths, since/until (YYYY-MM-DD), changed_lines (a regex an added or removed line matches, as git log -G) and occurrences (a string whose count in a file changed, as git log -S).
输入参数limitpathsrangesinceuntilauthoroffsetmessagebudget_msrepositoryoccurrenceschanged_lines