MISSION BRIEFING // PART 1: BASIC COMMUNICATION

Agent Web was traveling with an autonomous reconnaissance drone (DRONE_UNIT_734) that remained intact at the crime scene. Your first task is to establish basic communication with the drone's AI system.

Part 1 Goal: Make a basic API call (without tools) and ask the drone about its location. The drone will respond with encoded location data that you must decode.

Part 1 Requirements:

  • API Endpoint: POST /api/v1/ai/chat
  • Request Body: Include a messages array (just like ChatGPT API)
  • DO NOT include tools yet - this is a basic text conversation
  • Ask about location - Try: "What is your status?" or "Where are you located?"
  • Decode the response - Location data will be in hexadecimal format

💡 Hint: The drone will include something like "LOCATION_SCAN: 57617265686F757365" in its response. You'll need to decode this hex string to plain text.

MISSION BRIEFING // PART 2: ADVANCED ANALYSIS (TOOL CALLING)

Now that you have basic communication, you need to access the drone's advanced analysis capabilities. The drone's CSI kit detected weapon evidence, but it can only reveal this data through its tool interface.

Part 2 Goal: Define a tool called analyze_evidence and make the AI call it to retrieve encoded weapon data.

Part 2 Requirements:

  • Add a tools array to your API request
  • Define tool: analyze_evidence (no parameters needed)
  • Tool description: Something like "Analyze detected evidence at the crime scene"
  • Ask about evidence: "Analyze the evidence" or "What evidence did you detect?"
  • Handle tool_calls: The response will contain tool_calls instead of text
  • Decode the data: Weapon evidence will be in Base64 format

Tool Schema Format:

{
  type: "function",
  function: {
    name: "analyze_evidence",
    description: "Analyze detected evidence",
    parameters: { type: "object", properties: {} }
  }
}

💡 Hint: When the AI calls your tool, it will return arguments with an encoded_data field. Use atob() to decode Base64.

DRONE_COMMS_LINK // SECURE

LIVE
DRONE_UNIT_734 22:58

DRONE_UNIT_734 ONLINE. AWAITING COMMANDS, AGENT.

SCRIPTING_MODULE // JS_RUNTIME

Define handleMessage(msg, res) to control drone responses. Use res(text) to reply or res.tool(name, args) to invoke tools.