rigshare_get_equipment
Retrieve complete details, specs, pricing, owner info, images, and booking link for any RIGShare equipment listing using its UUID.
Instructions
Fetch full details for a single RIGShare equipment listing by its UUID. Returns specs, pricing, owner info, images, and a deep-link URL for booking.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Equipment UUID (obtained from search_equipment results). |
Implementation Reference
- src/index.ts:405-445 (handler)The actual handler function for rigshare_get_equipment. Fetches a single listing by UUID from the public API, validates the UUID, and returns formatted text with title, division, category, make/model/year, condition, rates, remote/in-person access info, owner, rating, description, and booking URL.
/** Fetch a single listing by UUID. */ async function getEquipment(args: Record<string, unknown>) { const id = args.id; if (typeof id !== "string" || !/^[0-9a-f-]{36}$/i.test(id)) { return toolError("id must be a valid UUID"); } const url = `${RIGSHARE_API}/equipment/${encodeURIComponent(id)}`; const res = await fetchJson(url); if (res.status === 404) return toolError(`No active listing found for id ${id}.`); if (res.error) return toolError(res.error); const l = res.data?.data; if (!l) return toolError("Empty response from RIGShare API"); const rates = Object.entries(l.rates_usd || {}) .filter(([, v]) => v !== null && v !== undefined) .map(([k, v]) => `${k.replace(/_/g, " ")}: $${v}`) .join(", "); const remote = l.remote_access?.enabled ? `Remote access: ${l.remote_access.access_type}${l.remote_access.region ? ` (${l.remote_access.region})` : ""}${l.remote_access.requires_mfa ? " · requires MFA" : ""}${l.remote_access.specs ? `\nSpecs: ${l.remote_access.specs}` : ""}` : `In-person pickup · ${l.location?.city || ""}, ${l.location?.state || ""}`; const description = [ `${l.title}`, `Division: ${l.division} · Category: ${l.category}`, [l.make, l.model, l.year].filter(Boolean).join(" "), `Condition: ${l.condition || "unspecified"}`, `Rates: ${rates || "contact owner"}`, remote, `Owner: ${l.owner?.display_name || "—"}${l.owner?.verified ? " (ID verified)" : ""}`, `Rating: ${l.rating?.average ?? "—"} (${l.rating?.count ?? 0} reviews)`, "", l.description || "", "", `Book at: ${l.url}`, ] .filter(Boolean) .join("\n"); return toolText(description); } - src/index.ts:307-308 (registration)Registers the tool name 'rigshare_get_equipment' in the CallToolRequestSchema switch statement, dispatching to the getEquipment function.
case "rigshare_get_equipment": return await getEquipment(args || {}); - src/index.ts:143-158 (schema)The tool definition with input schema registered in the ListToolsRequestSchema handler. Defines the tool name, description, and that it requires a single 'id' parameter of type string with uuid format.
{ name: "rigshare_get_equipment", description: "Fetch full details for a single RIGShare equipment listing by its UUID. Returns specs, pricing, owner info, images, and a deep-link URL for booking.", inputSchema: { type: "object", required: ["id"], properties: { id: { type: "string", format: "uuid", description: "Equipment UUID (obtained from search_equipment results).", }, }, }, },