Skip to content

Skill: Room types

$0.064 per callUSDC via x402POST /api/skill/room-types

One row per room or unit type on a hotel or rental page: sleeps, beds, kitchen, appliances and parking in the page's own words, "not listed" where it is silent...

Category: Skill packsTags: skill-pack workflow room-types hotel rooms rental amenities unitsPack overview

Try in playground →

Details

One row per room or unit type on a hotel or rental page: sleeps, beds, kitchen, appliances and parking in the page's own words, "not listed" where it is silent, and one question answered from its photos (model-backed). Room types skill pack: one x402 payment runs 3 underlying tools (page-images, html-meta, image-describe); partial-success per step.

Parameters

NameTypeRequiredDescription
urlstringyesPage with the room or unit types, or one type's own page Also accepted as link, uri, href, page.
questionstringnoOptional: one question to ask of the page's photos (up to 6); name the place, as in "Is there a dishwasher in this kitchen?" The example sends Is there a refrigerator?.

Example request

curl -i -X POST https://agent402.tools/api/skill/room-types \
  -H "Content-Type: application/json" \
  -d '{"url":"https://agent402.tools/fixtures/sample-rooms.html","question":"Is there a refrigerator?"}'

Watch a call get paid

RequestPOST /api/skill/room-types
402$0.064 USDC
SignPAYMENT-SIGNATURE
Settleon 14 chains
Answer200 OK
ReceiptAgent402-ReceiptEd25519

Example response

{
  "pack": "room-types",
  "rows": [
    {
      "name": "Garden Studio",
      "sleeps": "Sleeps 2.",
      "bedrooms": "Garden Studio",
      "beds": "One queen bed.",
      "bathrooms": "not listed",
      "size": "not listed",
      "kitchen": "Full kitchen with a refrigerator, stove and oven.",
      "refrigerator": "Full kitchen with a refrigerator, stove and oven.",
      "stove": "Full kitchen with a refrigerator, stove and oven.",
      "microwave": "not listed",
      "dishwasher": "not listed",
      "washerDryer": "not listed",
      "parking": "Free parking.",
      "sourcePage": "https://agent402.tools/fixtures/sample-rooms.html",
      "photoAnswer": {
        "answer": "yes",
        "confidence": "high",
        "image": "https://agent402.tools/fixtures/sample-kitchen.png"
      }
    }
  ],
  "structuredRooms": [
    {
      "name": "Garden Studio",
      "type": "HotelRoom",
      "occupancy": "2",
      "beds": "1 Queen",
      "amenities": [
        "Full kitchen",
        "Free parking"
      ]
    },
    {
      "name": "Harbor Suite",
      "type": "Suite",
      "occupancy": "4",
      "beds": "1 King; 1 Sleeper sofa",
      "rooms": "1"
    }
  ],
  "untrustedContent": true,
  "args": {
    "url": "https://agent402.tools/fixtures/sample-rooms.html",
    "question": "Is there a refrigerator?"
  },
  "steps": [
    {
      "slug": "page-images",
      "ok": true,
      "result": {}
    },
    {
      "slug": "html-meta",
      "ok": true,
      "result": {}
    },
    {
      "slug": "image-describe",
      "ok": true,
      "result": {}
    }
  ],
  "summary": "3/3 steps succeeded",
  "aiGenerated": true
}
FieldTypeAlways presentIn the example
packstringyesroom-types
rowsarray of objectsyes1 item in the example
structuredRoomsarray of objectsyes2 items in the example
untrustedContentbooleanyestrue
argsobjectyes2 fields: url, question
stepsarray of objectsyes3 items in the example
summarystringyes3/3 steps succeeded
aiGeneratedbooleanyestrue

From an MCP client

catalog.call {
  "slug": "skill-room-types",
  "params": {
    "url": "https://agent402.tools/fixtures/sample-rooms.html",
    "question": "Is there a refrigerator?"
  }
}

Hosted connector (https://agent402.tools/mcp): paid in the call. Stdio package (npx -y agent402-mcp@0.21.0): pays from a wallet or AGENT402_CREDITS_KEY.

Errors and behavior

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
client.setSpendControls?.({ maxAmountPerPayment: "$0.064" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.AGENT_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/skill/room-types", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "url": "https://agent402.tools/fixtures/sample-rooms.html",
    "question": "Is there a refrigerator?"
  }),
});

Get a wallet or run npx -y agent402-mcp@0.21.0 wallet new.

The quote (Python)

import base64, json, urllib.error, urllib.request

req = urllib.request.Request("https://agent402.tools/api/skill/room-types", method="POST", data="{\"url\":\"https://agent402.tools/fixtures/sample-rooms.html\",\"question\":\"Is there a refrigerator?\"}".encode(), headers={"Content-Type": "application/json"})
try:
    urllib.request.urlopen(req)
except urllib.error.HTTPError as e:
    quote = json.loads(base64.b64decode(e.headers["PAYMENT-REQUIRED"]))
    print(e.code, [(a["network"], a["amount"]) for a in quote["accepts"]])  # the price, per chain, in base units

Related tools