# `pypi__resolve_dependencies`

Resolve all dependencies for a PyPI package recursively.

This tool performs comprehensive dependency resolution for a Python package,
analyzing the complete dependency tree including transitive dependencies.

Args:
package_name: The name of the PyPI package to analyze (e.g., 'pyside2', 'django')
python_version: Target Python version for dependency filtering (e.g., '3.10', '3.11')
include_extras: List of extra dependency groups to include (e.g., \['dev', 'test'\])
include_dev: Whether to include development dependencies (default: False)
max_depth: Maximum recursion depth for dependency resolution (default: 5)

Returns:
Dictionary containing comprehensive dependency analysis including:
\- Complete dependency tree with all transitive dependencies
\- Dependency categorization (runtime, development, extras)
\- Package metadata for each dependency
\- Summary statistics and analysis

Raises:
InvalidPackageNameError: If package name is empty or invalid
PackageNotFoundError: If package is not found on PyPI
NetworkError: For network-related errors

- Server: [PyPI](https://gateway.mcpharbor.dev/docs/servers/pypi) (`dev.mcpharbor.gateway/pypi`)
- Price per call: $0.0001 (100 micro-USD); only tools/call is charged
- Endpoint: `https://gateway.mcpharbor.dev/mcp` or `https://gateway.mcpharbor.dev/mcp/pypi`
- Upstream tool: exposed by the provider; called through this gateway as `pypi__resolve_dependencies`
- Provider terms: <https://policies.python.org/pypi.org/Terms-of-Service/> (verified 2026-09-19)
- Upstream API documentation: <https://docs.pypi.org/api/json/>
- Rate limit: 600 requests per minute

## Parameters

- `include_dev` (boolean, optional): Default: `false`.
- `include_extras` (any, optional)
- `max_depth` (integer, optional): Default: `5`.
- `package_name` (string, required)
- `python_version` (any, optional)

## Example call

Request headers and body:

```http
POST /mcp HTTP/1.1
Host: gateway.mcpharbor.dev
Authorization: Bearer <your gateway API key>
Content-Type: application/json
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
Mcp-Method: tools/call
Mcp-Name: pypi__resolve_dependencies
```

```json
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "_meta": {
      "io.modelcontextprotocol/clientCapabilities": {},
      "io.modelcontextprotocol/clientInfo": {
        "name": "example-agent",
        "version": "1.0.0"
      },
      "io.modelcontextprotocol/protocolVersion": "2026-07-28"
    },
    "arguments": {
      "package_name": "example"
    },
    "name": "pypi__resolve_dependencies"
  }
}
```

A successful response:

```json
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "_meta": {
      "dev.mcpharbor.gateway/call": {
        "chargedMicroUsd": 100,
        "id": "<the id of this charge>"
      }
    },
    "content": [
      {
        "text": "<whatever the upstream tool returned>",
        "type": "text"
      }
    ],
    "resultType": "complete"
  }
}
```

This call costs $0.0001 (100 micro-USD). Reading this page and listing the tool cost nothing.
The `dev.mcpharbor.gateway/call` record in the result is the receipt for that charge. Each
POST is metered separately, so sending the same call again buys another one: see
[agent.txt](https://gateway.mcpharbor.dev/agent.txt), section 7, before retrying.

## Attribution

This provider asks for no attribution. Their terms still apply: see the table above.

## Tool definition

Exactly as `tools/list` returns it (free):

```json
{
  "_meta": {
    "dev.mcpharbor.gateway/pricing": {
      "currency": "USD",
      "pricePerCallMicroUsd": 100
    }
  },
  "description": "Resolve all dependencies for a PyPI package recursively.\n\nThis tool performs comprehensive dependency resolution for a Python package,\nanalyzing the complete dependency tree including transitive dependencies.\n\nArgs:\n    package_name: The name of the PyPI package to analyze (e.g., 'pyside2', 'django')\n    python_version: Target Python version for dependency filtering (e.g., '3.10', '3.11')\n    include_extras: List of extra dependency groups to include (e.g., ['dev', 'test'])\n    include_dev: Whether to include development dependencies (default: False)\n    max_depth: Maximum recursion depth for dependency resolution (default: 5)\n\nReturns:\n    Dictionary containing comprehensive dependency analysis including:\n    - Complete dependency tree with all transitive dependencies\n    - Dependency categorization (runtime, development, extras)\n    - Package metadata for each dependency\n    - Summary statistics and analysis\n\nRaises:\n    InvalidPackageNameError: If package name is empty or invalid\n    PackageNotFoundError: If package is not found on PyPI\n    NetworkError: For network-related errors",
  "inputSchema": {
    "properties": {
      "include_dev": {
        "default": false,
        "type": "boolean"
      },
      "include_extras": {
        "anyOf": [
          {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          {
            "type": "null"
          }
        ],
        "default": null
      },
      "max_depth": {
        "default": 5,
        "type": "integer"
      },
      "package_name": {
        "type": "string"
      },
      "python_version": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null
      }
    },
    "required": [
      "package_name"
    ],
    "type": "object"
  },
  "name": "pypi__resolve_dependencies",
  "outputSchema": {
    "additionalProperties": true,
    "type": "object"
  }
}
```
