> ## Documentation Index
> Fetch the complete documentation index at: https://resq-dependabot-github-actions-github-actions-478e18be3d.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Tools

<a id="resq_mcp.tools" />

# resq\_mcp.tools

Drone feed tools for the ResQ MCP server.

This module provides simulated drone feed functionality for development and testing.
It generates pseudo-random telemetry and analysis data for drone network sectors.

The simulation includes:

* 4 monitored sectors with predefined coordinates
* Random disaster scenario detection (fire, flood, medical, debris)
* Swarm status with variable battery and connectivity
* Drone deployment request handling

<a id="resq_mcp.tools.annotations" />

## annotations

<a id="resq_mcp.tools.random" />

## random

<a id="resq_mcp.tools.UTC" />

## UTC

<a id="resq_mcp.tools.datetime" />

## datetime

<a id="resq_mcp.tools.Final" />

## Final

<a id="resq_mcp.tools.Coordinates" />

## Coordinates

<a id="resq_mcp.tools.DeploymentStatus" />

## DeploymentStatus

<a id="resq_mcp.tools.DisasterScenario" />

## DisasterScenario

<a id="resq_mcp.tools.ErrorResponse" />

## ErrorResponse

<a id="resq_mcp.tools.NetworkStatus" />

## NetworkStatus

<a id="resq_mcp.tools.SectorAnalysis" />

## SectorAnalysis

<a id="resq_mcp.tools.SectorStatusSummary" />

## SectorStatusSummary

<a id="resq_mcp.tools.SwarmStatus" />

## SwarmStatus

<a id="resq_mcp.tools.DRONE_SECTORS" />

#### DRONE\_SECTORS

<a id="resq_mcp.tools.DISASTER_SCENARIOS" />

#### DISASTER\_SCENARIOS

<a id="resq_mcp.tools.scan_current_sector" />

#### scan\_current\_sector

```python theme={null}
def scan_current_sector(
        sector_id: str = "Sector-1") -> SectorAnalysis | ErrorResponse
```

Scan a specific sector for anomalies using simulated drone sensors.

Simulates drone-based surveillance with probabilistic disaster detection.
In production, this would integrate with actual drone telemetry and
edge AI processing results from the MCP drone feed server.

Detection Logic:

* 30% probability of detecting a disaster scenario per scan
* Randomly selects from predefined disaster templates
* Generates NeoFS evidence URL for blockchain submission
* Returns "clear" status if no anomalies detected

**Arguments**:

* `sector_id` - The sector to scan ("Sector-1" through "Sector-4").
  Default is "Sector-1".

**Returns**:

* `SectorAnalysis` - Complete scan results with detection data and
  recommended actions if sector exists.
* `ErrorResponse` - Error message if sector\_id is invalid.

**Example**:

> > > result = scan\_current\_sector("Sector-2")
> > > if isinstance(result, SectorAnalysis):
> > > ...     if result.status == "CRITICAL\_ALERT":
> > > ...         print(f"Alert: \{result.detected\_object}")
> > > ...         print(f"Action: \{result.recommended\_action}")

**Notes**:

This is a simulation function. Production deployment would replace
random detection with actual ML model inference on drone imagery.

<a id="resq_mcp.tools.get_all_sectors_status" />

#### get\_all\_sectors\_status

```python theme={null}
def get_all_sectors_status() -> NetworkStatus
```

Get the status of all monitored sectors in the surveillance network.

Aggregates scan results across all configured sectors to provide
network-wide situational awareness for operator dashboards.

**Returns**:

* `NetworkStatus` - Complete network status including:
  * Total sector count
  * Per-sector status summaries (detected objects, confidence)
  * Critical alert count for priority filtering
  * Timestamp of status generation

**Example**:

> > > status = get\_all\_sectors\_status()
> > > print(f"Network: \{status.total\_sectors} sectors")
> > > print(f"Critical Alerts: \{status.critical\_alerts}")
> > > for sector\_id, summary in status.sectors.items():
> > > ...     if summary.status == "CRITICAL\_ALERT":
> > > ...         print(f"\{sector\_id}: \{summary.detected\_object}")

**Notes**:

Calls scan\_current\_sector() for each sector, so inherits its
simulation behavior (random detection).

<a id="resq_mcp.tools.get_drone_swarm_status" />

#### get\_drone\_swarm\_status

```python theme={null}
def get_drone_swarm_status() -> SwarmStatus
```

Get the overall operational status of the drone swarm.

Provides fleet-wide health metrics for monitoring drone readiness
and availability. Used by operators to assess deployment capacity.

Simulation Behavior:

* Total drones: Fixed at 3 for development
* Active drones: Random 2-3 (some may be charging/maintenance)
* Average battery: Random 60-100% (simulated degradation)
* Network status: Always "operational" in dev mode

**Returns**:

* `SwarmStatus` - Fleet metrics including:
  * Total and active drone counts
  * Fleet-wide average battery percentage
  * Network connectivity status
  * Last sync timestamp (auto-generated)

**Example**:

> > > swarm = get\_drone\_swarm\_status()
> > > if swarm.average\_battery \< 30:
> > > ...     print("WARNING: Low fleet battery")
> > > print(f"\{swarm.active\_drones}/\{swarm.total\_drones} drones active")

**Notes**:

Production would aggregate real telemetry from the MCP drone feed
server, reporting actual battery, GPS lock, and link quality.

<a id="resq_mcp.tools.request_drone_deployment" />

#### request\_drone\_deployment

```python theme={null}
def request_drone_deployment(
        sector_id: str,
        priority: str = "high") -> DeploymentStatus | ErrorResponse
```

Request deployment of a drone to a specific sector.

Simulates drone dispatch request handling with immediate assignment.
In production, this would interface with the drone control module
and mission planning system to allocate resources.

Simulation Behavior:

* Assigns random drone unit (UNIT-001 through UNIT-003)
* Generates random ETA (30-120 seconds)
* Always returns "deployed" status if sector valid

**Arguments**:

* `sector_id` - The target sector for deployment (e.g., "Sector-1").
* `priority` - Deployment urgency level. Higher priority missions
  preempt lower priority tasks. Valid values:
  * "low": Routine surveillance
  * "medium": Follow-up investigation
  * "high" (default): Active incident response
  * "critical": Immediate life-threatening situation

**Returns**:

* `DeploymentStatus` - Confirmation with assigned drone and ETA if
  sector is valid.
* `ErrorResponse` - Error message if sector\_id is invalid.

**Example**:

> > > status = request\_drone\_deployment("Sector-3", priority="critical")
> > > if isinstance(status, DeploymentStatus):
> > > ...     print(f"Drone \{status.drone\_id} dispatched")
> > > ...     print(f"ETA: \{status.eta\_seconds} seconds")

**Notes**:

Production would check drone availability, battery levels, and
weather conditions before confirming deployment.
