# SafeCube Container Tracking MCP

> SafeCube Container Tracking lets your AI agent audit maritime shipments and retrieve real-time data directly from global container sources. It provides current vessel locations, full shipment status audits, and historical event timelines without needing a logistics dashboard. Use it to instantly query where containers are, what stage their shipments are in, and when they left port.

## Overview
- **Category:** data-analytics
- **Price:** Free
- **Tags:** maritime-logistics, container-tracking, shipment-monitoring, real-time-data, supply-chain-visibility

## Description

**SafeCube Container Tracking lets your AI agent audit maritime shipments and pull real-time data straight from global container sources. You'll get current vessel locations, full shipment status audits, and historical event timelines without ever touching a logistics dashboard.**

**First, you check the service connection with `check_api_status`. This tool runs before anything else; it confirms whether the entire SafeCube endpoint is live and operational. If this status check fails, your agent won't waste time running queries because the service isn't up for business.**

**To get a handle on what you've got moving right now, start by using `list_active_shipments`. This tells your agent to query your account and immediately returns a list of every single shipment currently being tracked by SafeCube. You get the IDs and high-level status data for all active cargo in one go.**

**Once you know what's active, you can pinpoint exactly where a container is using `get_container_tracking`. Simply pass the specific maritime container number to this tool, and your agent pulls back real-time information. You get the container’s exact position, its current status code, and the name of the vessel it's riding on. This tells you everything about where that box is sitting in the ocean or port right now.**

**Need to know more than just the location? When you need a full audit, use `get_shipment_events`. You provide a specific shipment ID, and this tool fetches the complete timeline of tracking milestones. It shows every recorded event—when it left port, when customs checked it, or what its status was on Tuesday versus Friday. This gives you an absolute historical record.**

**You never have to jump between multiple systems or decipher complex spreadsheets again. Your agent handles all this stuff for you: 

*   **Real-Time Location:** Give your agent a container number, and it tells you the current position and vessel details.
*   **Inventory View:** Have it list every active shipment ID so you know exactly what's moving in your account right now.
*   **Full Audit Trail:** Provide a specific shipment ID, and it spits out a complete history of all recorded logistics milestones. 

It’s straightforward: the agent confirms service health, lists everything that’s running, lets you check the precise location of any container number, and then gives you the whole story on an old shipment using its unique ID. You just ask your AI client what it needs to know, and SafeCube delivers all the maritime data it can.**

## Tools

### check_api_status
Reports whether the overall SafeCube service connection is currently active and operational.

### get_shipment_events
Retrieves the full timeline of tracking milestones and events associated with one specific shipment ID.

### get_container_tracking
Pulls real-time status, position, and vessel metadata for a single, specified maritime container number.

### list_active_shipments
Returns a list of all shipments currently tracked in your account, providing IDs and high-level status data.

## Prompt Examples

**Prompt:** 
```
Track container 'TCNU1234567' using SafeCube.
```

**Response:** 
```
I've retrieved the tracking data for container TCNU1234567! It is currently identified as 'En Route' aboard the vessel 'MSC OSCAR'. The current ETA is May 15th. Would you like the full event history metadata for this shipment?
```

**Prompt:** 
```
List all my active shipments.
```

**Response:** 
```
I've retrieved your active shipment catalog from SafeCube! You have 5 active containers, including 3 en route and 2 awaiting discharge. I can provide the unique shipment IDs and vessel metadata for each of these tracking records.
```

**Prompt:** 
```
What are the latest events for shipment ID 'SHIP-123'?
```

**Response:** 
```
I've identified the events for shipment SHIP-123! The latest marker is 'Vessel Departure' from Singapore, recorded on May 10th. I can assist you with an audit of the previous port calls and duration markers if you'd like.
```

## Capabilities

### Get current container location
You pass a specific container number and get its real-time position, status, and vessel name.

### List all active shipments
The agent queries your account and returns a catalog of every shipment currently being tracked by SafeCube.

### Audit shipment history
You provide a shipment ID, and the agent retrieves a full list of all recorded tracking events for that specific cargo.

### Check service health
The agent runs `check_api_status` to confirm the SafeCube endpoint is operational before running any queries.

## Use Cases

### Client asks for ETA on delayed cargo
A client calls asking about container 'TCNU1234567'. Instead of manually checking multiple portals, the agent runs `get_container_tracking`. It instantly confirms the current vessel ('MSC OSCAR'), its status ('En Route'), and the updated ETA. The problem is solved in a single conversational turn.

### Need to audit all containers leaving port this week
The Ops Lead needs visibility on everything moving out of Singapore. They prompt their agent with 'Show me all shipments departing soon.' The agent runs `list_active_shipments` and filters the results, providing a unique ID and current status for every relevant container.

### Investigating a discrepancy in shipment records
A Trade Researcher finds that the expected arrival date is wrong. They ask their agent to 'List all events for SHIP-123.' The agent runs `get_shipment_events` and provides the full log, showing exactly which milestone (e.g., customs clearance) was missed or delayed.

### Pre-flight check on tracking tools
Before running a major batch of queries for 100 containers, the system runs `check_api_status`. If it fails, the agent immediately alerts the user. This prevents costly failures and ensures your subsequent calls to `get_container_tracking` are reliable.

## Benefits

- See current location details with `get_container_tracking`. Just give it a container number, and your agent returns the real-time status, vessel name, and ETA immediately. No dashboard needed.
- Use `list_active_shipments` to get an instant catalog of everything you're tracking. You can see all active shipment IDs in one go, which is key for knowing what needs attention.
- Audit full timelines with `get_shipment_events`. This tool doesn't just give status; it shows the sequence—when did the vessel depart? What were the previous port calls?
- Keep your workflow running by calling `check_api_status` first. It verifies that SafeCube is online before you waste time querying stale data.
- It handles global scope. Whether you're managing Asia-Europe routes or regional port delays, the agent acts as a real-time maritime consultant for accurate status reporting.

## How It Works

The bottom line is that your AI client handles all the API calls; you just talk to it like talking to a logistics expert.

1. First, subscribe to the server and provide your unique SafeCube API Key.
2. Your AI client calls a tool (like `list_active_shipments`) with a natural language prompt. The agent translates this into an API call.
3. The agent executes the query, pulls the structured data from SafeCube, and presents it back to you as plain text.

## Frequently Asked Questions

**How do I check if SafeCube Container Tracking is working?**
Run `check_api_status`. This tool immediately confirms if the API connection to SafeCube is operational, saving you time before making complex tracking requests.

**What kind of data does get_container_tracking provide?**
`get_container_tracking` gives you real-time status information. You get the container's current position, the vessel it is on, and its most recent estimated time of arrival (ETA).

**Can I list all my shipments at once using SafeCube Container Tracking?**
Yes, use `list_active_shipments`. This tool queries your account for a catalog of every shipment currently tracked by SafeCube. It gives you the necessary IDs to run deeper audits later.

**What is the difference between get_container_tracking and get_shipment_events?**
They track different things. `get_container_tracking` shows where the container *is* right now. `get_shipment_events` provides a history of every milestone—like 'Port Departure' or 'Customs Cleared.'

**What happens if I enter an invalid ID when using `get_container_tracking`?**
The tool returns a 404 error code indicating the container number was not found. You must verify the alpha-numeric identifier and check for typos or incorrect formatting.

**What is the scope of data retrieved by `list_active_shipments`?**
This tool only lists shipments currently marked as 'active' within your account. It will not return containers that have already arrived, been discharged, or are otherwise closed.

**Are there rate limits when calling `get_container_tracking`?**
Yes, the service enforces a limit of 10 requests per minute. If you exceed this threshold, the API will return a 429 error code; wait one minute before retrying.

**How does `get_shipment_events` handle missing shipment IDs?**
If you provide a non-existent shipment ID, the tool fails and reports that no records match the provided identifier. Always ensure the ID belongs to an active or historical shipment.

**How do I find my SafeCube API Key?**
Log in to your [**SafeCube account**](https://app.safecube.ai/), navigate to the 'API' or 'Integrations' section in your dashboard, and generate a new Bearer Token. Copy and paste it below.

**What container formats are supported?**
The API supports standard 11-character BIC codes (e.g., TCNU1234567) used by global maritime shipping lines.

**Can the agent show real-time ETAs?**
Yes. The `get_container_tracking` tool retrieves the current Estimated Time of Arrival (ETA) metadata for specified containers.