nexus_get_dependency_snippet
Generate ready-to-paste dependency snippets (Maven, Gradle, npm, pip, Docker) for an artifact and resolve the latest release when version or name is omitted.
Instructions
Generate ready-to-paste dependency snippets (Maven pom.xml, Gradle, npm, Docker pull/login, pip, or a direct download URL) for an artifact so it can be added to a codebase. If version/name/format are omitted, resolves the latest release in the repository first. For Docker, resolves the actual pull address — preferring path-based routing (docker.pathEnabled, which works behind a reverse proxy like nginx that only exposes HTTPS) over a dedicated connector host:port when both are configured. Also returns the repository's browse URL (repository_url) and access_help pointing to where to request repo access (Nexus's REST API has no concept of 'required role' for a repository). Never includes real credentials — only environment-variable placeholders.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"repository": "<repository>"
},
"name": "nexus_get_dependency_snippet"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Component/package name (omit to auto-resolve the latest release) | |
| group | No | Optional group filter (Maven groupId, etc.) | |
| format | No | Component format (maven2, npm, docker, pypi, raw, etc.) | |
| version | No | Version to target (omit to use the latest release) | |
| build_tool | No | Restrict output to one tool's snippets, e.g. 'maven', 'gradle', 'npm', 'pip', 'docker'. Omit to get all applicable snippets for the format. | |
| repository | Yes | Repository the artifact lives in |