{"status":"ok","protocolVersion":"2024-11-05","serverInfo":{"name":"trackkr-mcp","title":"Trackkr MCP Server — Smart Lockerless Parcel Management","version":"2.1.1"},"capabilities":{"tools":{"listChanged":false}},"tools":[{"name":"get_pending_parcels","description":"Fetches the current ledger of uncollected packages, highlights aging stats (5+ days), enriches each with occupant contact preferences and notification/telemetry history, and returns structured JSON context.","inputSchema":{"type":"object","required":[],"additionalProperties":false,"properties":{"businessId":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]{1,128}$","description":"Optional tenant businessId filter. When provided, scans only that property."},"thresholdDays":{"type":"number","minimum":1,"maximum":365,"default":5,"description":"Minimum age in days for a Pending parcel to be highlighted in the aging report (1-365, default 5)."},"emitTelemetry":{"type":"boolean","default":true,"description":"When true, emits a STALE_3_DAYS event to parcel_telemetry for newly stale parcels."},"maxResults":{"type":"integer","minimum":1,"maximum":500,"default":200,"description":"Maximum number of pending parcels to return (1-500, default 200)."}}}},{"name":"log_incoming_parcel","description":"Accepts parsed text from Google Cloud Vision OCR label scans and/or a trusted Firebase Storage photoUrl, cross-references internal Firestore unit listings, enforces a 4-hour idempotent lock on (trackingNumber + unitId), and schedules automated email alerts via SMTP.","inputSchema":{"type":"object","required":["businessId"],"additionalProperties":false,"properties":{"businessId":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]{1,128}$","description":"Tenant business identifier (must match the authenticated property businessId, 1-128 alphanumeric/dash/underscore chars)."},"rawOcrText":{"type":"string","maxLength":10000,"description":"Raw OCR text extracted from a shipping label or envelope (up to 10,000 characters). Used to extract tracking numbers and match unit/occupant. At least one of rawOcrText, photoUrl, or unitId is required."},"photoUrl":{"type":"string","maxLength":2047,"description":"Public HTTPS Firebase Cloud Storage URL of the package photo (must be hosted on firebasestorage.googleapis.com, storage.googleapis.com, or *.firebasestorage.app). Embedded in the resident notification email."},"trackingNumber":{"type":"string","maxLength":128,"description":"Optional explicit carrier tracking number (UPS 1Z..., Amazon TBA..., USPS, or FedEx). Paired with unitId for 4-hour idempotent deduplication."},"unitId":{"type":"string","maxLength":80,"description":"Optional explicit Firestore unit document ID under businesses/{businessId}/units/{unitId}. If omitted, resolved deterministically from rawOcrText."},"occupantId":{"type":"string","maxLength":80,"description":"Optional explicit occupant ID within the matched unit. If omitted, resolved deterministically from rawOcrText."},"typeOfMail":{"type":"string","enum":["letter","envelope","small box","big box","furniture/appliances","other"],"default":"small box","description":"Package category: \"letter\" | \"envelope\" | \"small box\" | \"big box\" | \"furniture/appliances\" | \"other\"."},"qty":{"type":"integer","minimum":1,"maximum":99,"default":1,"description":"Number of parcels in this delivery (integer between 1 and 99)."},"notes":{"type":"string","maxLength":1999,"default":"","description":"Optional staff or carrier notes (maximum 1,999 characters)."},"pickupMessage":{"type":"string","maxLength":100,"description":"Optional custom pickup location instruction included in the resident notification email (maximum 100 characters)."},"dateReceived":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Optional ISO date received in YYYY-MM-DD format (defaults to current UTC date)."},"timeReceived":{"type":"string","minLength":1,"maxLength":32,"description":"Optional time received string (e.g. \"2:30 PM\", defaults to current UTC time)."},"idempotencyMode":{"type":"string","enum":["merge","reject"],"default":"merge","description":"Behavior when the same (trackingNumber + unitId) was already logged within the last 4 hours: \"merge\" increments qty on the existing pending parcel; \"reject\" returns REJECTED_DUPLICATE without modifying."},"actor":{"type":"object","description":"Audit identity of the caller or AI agent triggering the mutation.","required":["id","type"],"properties":{"id":{"type":"string","minLength":1,"maxLength":128,"description":"Unique identifier of the user, agent, or system actor."},"type":{"type":"string","enum":["user","agent","system"],"default":"agent","description":"Actor classification (\"user\" | \"agent\" | \"system\")."}}}}}},{"name":"release_parcel_with_signature","description":"Updates parcel state to Picked Up, records the pickup timestamp and recipient name, securely saves the digital signature PNG layout to Firebase Storage, and emits a PARCEL_RELEASED telemetry event.","inputSchema":{"type":"object","required":["businessId","parcelId","pickedUpBy"],"additionalProperties":false,"properties":{"businessId":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]{1,128}$","description":"Tenant business identifier owning the parcel (1-128 alphanumeric/dash/underscore chars)."},"parcelId":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]{1,128}$","description":"Firestore parcel document ID under businesses/{businessId}/parcels/{parcelId}."},"pickedUpBy":{"type":"string","minLength":1,"maxLength":120,"description":"Full name of the resident or authorized person who signed for and collected the parcel (1-120 characters)."},"signatureUrl":{"type":"string","maxLength":2047,"description":"Trusted HTTPS Firebase Cloud Storage URL of the captured recipient signature PNG. Either signatureUrl or signatureBase64 must be supplied."},"signatureBase64":{"type":"string","minLength":16,"maxLength":3000000,"description":"Base64-encoded PNG signature image (up to 2MB decoded). Automatically uploaded to businesses/{businessId}/signatures/{parcelId}.png when signatureUrl is omitted."},"datePickedUp":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Optional pickup date in YYYY-MM-DD format (defaults to current UTC date)."},"timePickedUp":{"type":"string","minLength":1,"maxLength":32,"description":"Optional pickup time string (e.g. \"4:15 PM\", defaults to current UTC time)."},"releaseNotes":{"type":"string","maxLength":500,"description":"Optional audit note recorded in PARCEL_RELEASED telemetry (maximum 500 characters)."},"actor":{"type":"object","description":"Audit identity of the staff user or AI agent releasing the parcel.","required":["id","type"],"properties":{"id":{"type":"string","minLength":1,"maxLength":128,"description":"Unique identifier of the user, agent, or system actor."},"type":{"type":"string","enum":["user","agent","system"],"default":"agent","description":"Actor classification (\"user\" | \"agent\" | \"system\")."}}}}}}]}