# `pypi__get_package_dependencies`

Get dependency information for a PyPI package.

This tool retrieves comprehensive dependency information for a Python package,
including runtime dependencies, development dependencies, and optional dependencies.

Args:
package_name: The name of the PyPI package to query (e.g., 'django', 'flask')
version: Specific version to query (optional, defaults to latest version)

Returns:
Dictionary containing dependency information including:
\- Runtime dependencies and development dependencies
\- Optional dependency groups
\- Python version requirements
\- Dependency counts and summary statistics

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__get_package_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

- `package_name` (string, required)
- `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__get_package_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__get_package_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": "Get dependency information for a PyPI package.\n\nThis tool retrieves comprehensive dependency information for a Python package,\nincluding runtime dependencies, development dependencies, and optional dependencies.\n\nArgs:\n    package_name: The name of the PyPI package to query (e.g., 'django', 'flask')\n    version: Specific version to query (optional, defaults to latest version)\n\nReturns:\n    Dictionary containing dependency information including:\n    - Runtime dependencies and development dependencies\n    - Optional dependency groups\n    - Python version requirements\n    - Dependency counts and summary statistics\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": {
      "package_name": {
        "type": "string"
      },
      "version": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null
      }
    },
    "required": [
      "package_name"
    ],
    "type": "object"
  },
  "name": "pypi__get_package_dependencies",
  "outputSchema": {
    "additionalProperties": true,
    "type": "object"
  }
}
```
