Repository parameters (
name, remote, defaultBranch) must be provided together or omitted entirely. list_repositories returns them.Account Tools
Call these first.get_me is the one tool that runs before you pick an organization. It never returns tenant_required, and it lists each organization’s handle and id. With OAuth, pass either as the organization argument, or as the X-Greptile-Tenant header, on every other tool. An API key is bound to its own organization and ignores both. list_repositories returns the identifiers the pull request, code review, and knowledge base tools take.
get_me
Get the calling credential and every organization it can reach.- Parameters
- Response
No parameters.
list_repositories
List the repositories Greptile knows in the selected organization, sorted by name.- Parameters
- Response
Pull Request Tools
list_pull_requests / list_merge_requests
List PRs with optional filtering. Both tool names work identically.- Parameters
- Response
get_merge_request
Get detailed PR information including review analysis.- Parameters
- Response
list_merge_request_comments
Get all comments for a PR with filtering options.- Parameters
- Response
Two Greptile identities: PR summaries come from
greptile-apps[bot], inline comments from greptile-apps. Use isGreptileComment: true to catch both.Code Review Tools
list_code_reviews
List code reviews with optional filtering.- Parameters
- Response
Status values:
PENDING, REVIEWING_FILES, GENERATING_SUMMARY, COMPLETED, FAILED, SKIPPEDget_code_review
Get detailed information for a specific code review.- Parameters
- Response
trigger_code_review
Start a new code review on a PR.- Parameters
- Response
Comment Search Tool
search_greptile_comments
Search across all Greptile comments.- Parameters
- Response
Custom Context Tools
list_custom_context
List your organization’s coding patterns.- Parameters
- Response
get_custom_context
Get details for a specific pattern.- Parameters
- Response
search_custom_context
Search patterns by content.- Parameters
- Response
create_custom_context
Create a new coding pattern.- Parameters
- Response
Scope structure:
There’s no
delete_custom_context tool. To disable a pattern, set status: "INACTIVE".Knowledge Base Tools
Greptile can build a knowledge base for a repository: versioned Markdown describing how that codebase works. Greptile writes it, refreshes it on a schedule, and reads it while reviewing. These tools hand your agent the same material.Knowledge base synthesis is enabled per organization as a rollout, not by default. If your repositories have not been enrolled,
list_knowledge_bases returns an empty list. Ask your Greptile contact to enable it.
These are the only paths served.
get_knowledge_base_document and the sections parameter reject anything else as an invalid parameter; the listing and search tools simply omit it, so an empty result is not proof the material does not exist.
Start at list_knowledge_bases. It returns namespaceId, the handle the other three tools take. You can pass the repository’s exact name instead — see Identifying a repository. Paths returned by list_knowledge_base_documents and search_knowledge_base are the paths get_knowledge_base_document accepts.
Errors. Alongside parameter-validation failures (Invalid params: …, returned verbatim) and a generic An internal error occurred while processing your request, the knowledge base tools return these:
A repository with nothing published is not an error: the list and search tools return empty results.
Identifying a repository
namespaceId takes either form, tried in this order:
- The handle from
list_knowledge_bases. Opaque, always unambiguous. - The repository’s exact name,
owner/repo. Case-sensitive, no partial or wildcard match, and capped at 128 characters — a longer name can only be reached by its handle. Names are not unique within an organization, and the name resolves within your own access: it fails as ambiguous only when two or more matches are visible to you. If your scope leaves exactly one visible, that one resolves even though the organization holds others by the same name.
Repository not found: no knowledge base repository matches that identifier in your organization.
Each entry is name (handle), so you can retry either form straight away. The list holds up to 20 repositories, and a 2,000-character cap can cut it shorter; a cut list ends with (this list is not exhaustive) and its last entry may be cut mid-value.
The list names every repository you can identify, which is a superset of those that have a knowledge base — list_knowledge_bases is still the authoritative list of the ones that do. It comes from your own access, not from the value you sent, so it reads the same whatever you asked for. The hint is best-effort: the message appears alone if you can reach no repositories, and also if the lookup behind it fails. No list is not proof you have none.
list_knowledge_bases
List the repositories whose knowledge base you can read.- Parameters
- Response
list_knowledge_base_documents
List the document paths in one repository’s current knowledge base.- Parameters
- Response
get_knowledge_base_document
Get one document’s Markdown.- Parameters
- Response
Reads always follow the section’s current version. You cannot request a historical snapshot.A path outside
index.md and docs/**.md is rejected as an invalid parameter, which is a different error from Knowledge base document not found. Take paths from list_knowledge_base_documents rather than constructing them.search_knowledge_base
Search one repository’s knowledge base for a substring. Case-insensitive.- Parameters
- Response
Truncation and paging. The scan stops at a work budget: documents read, characters scanned, response size, or a 15-second deadline. When it stops early the response carries
truncated: true and a truncationReason of document_scan_cap, scanned_character_cap, response_character_cap, or time_budget.Search has no offset and no cursor. Reaching limit is not reported as truncation, but matches past it cannot be fetched — total above returned is the only signal, and narrowing the query is the only way to reach them. The two list tools do page exactly with offset.Analytics Tools
These three tools read the same data as the Analytics dashboard, scoped to the repositories you can access.Time range.
get_analytics_overview and list_analytics_findings accept
startTime and endTime together or not at all — one without the other is
rejected. Omit both for the default range. Both are ISO 8601 instants with Z
or a numeric UTC offset, and startTime must be before endTime. The year you
supply is four digits, so 1000 through 9999. Separately, each instant must
still resolve to year 1000 or later after timeZone is applied — a value
near the lower bound can therefore be accepted in UTC and rejected in a zone
with a negative offset. There is no matching upper check on the resolved year,
so an instant late in 9999 is accepted even in a zone that carries it into year
10000.Array filters. Every array parameter below — teamNames,
repositoryNames, authorLogins, severities, statuses — must hold at
least one entry, and string entries must be non-empty. Passing [] is an
Invalid params error, not “no filter”. Omit the parameter instead.list_analytics_filter_options
List the teams, repositories, or authors you can filter by. Use it to discover valid values for theteamNames, repositoryNames, and authorLogins
parameters of the other two tools.
- Parameters
- Response
get_analytics_overview
Get the analytics overview: summary metrics with period-over-period changes, chart series, repository and contributor rankings, pull-request rankings, and comment ratings.- Parameters
- Response
list_analytics_findings
List findings with severity and security totals and trends.- Parameters
- Response