scene_service.mcp_tools

FastMCP tool definitions for read-only Scene queries.

Functions

attach_scene_graph_store(store)

attach_state(*, registry[, hub, robot_geometry])

Attach live Scene dependencies used by read-only MCP handlers.

get_object_context(req)

Return a single object's scene graph node, its direct relations, and nearby objects sorted by distance.

get_scene_graph(_req)

Return the current scene graph snapshot — all stable nodes with captions and their LLM-inferred spatial relations.

goal_near(req)

Find a navigation-safe approach pose near a physical scene object.

list_objects(_req)

Return perceived objects plus compatibility region entries.

list_relations(req)

List scene graph edges, optionally filtered by relation type.

scene_service.mcp_tools.attach_annotation_store(store: AnnotationStore | None) → None[source]
scene_service.mcp_tools.attach_scene_graph_store(store: SceneGraphStore) → None[source]
scene_service.mcp_tools.attach_state(*, registry: ObjectRegistry, hub=None, robot_geometry: RobotGeometryState | None = None) → None[source]

Attach live Scene dependencies used by read-only MCP handlers.

async scene_service.mcp_tools.get_object_context(req: GetObjectContext_Request) → GetObjectContext_Response[source]

Return a single object’s scene graph node, its direct relations, and nearby objects sorted by distance. Useful for Pilot to reason about one object’s context without fetching the full graph. Contract: robonix/system/scene/get_object_context.

async scene_service.mcp_tools.get_robot_context(_req: GetRobotContext_Request) → GetRobotContext_Response[source]

Return one coherent map-frame spatial snapshot for Pilot.

async scene_service.mcp_tools.get_scene_graph(_req: GetSceneGraph_Request) → GetSceneGraph_Response[source]

Return the current scene graph snapshot — all stable nodes with captions and their LLM-inferred spatial relations. Contract: robonix/system/scene/get_scene_graph.

async scene_service.mcp_tools.goal_near(req: GoalNear_Request) → GoalNear_Response[source]

Find a navigation-safe approach pose near a physical scene object. Returns map-frame (x, y, yaw); pass to navigation/navigate.

Region annotations are deliberately not accepted. Resolve those through goal_region so the returned pose is constrained to the region polygon.

reachable=false when:

  • the object ID is not in the registry;

  • mapping is not publishing an occupancy grid; or

  • no free cell exists within the target search radius.

Contract: robonix/system/scene/goal_near.

async scene_service.mcp_tools.goal_region(req: GoalRegion_Request) → GoalRegion_Response[source]

Resolve a region annotation to a safe map-frame pose inside its polygon.

Use this for named regions before navigation/navigate. The result never falls outside the region polygon. Contract: robonix/system/scene/goal_region.

async scene_service.mcp_tools.list_objects(_req: ListObjects_Request) → ListObjects_Response[source]

Return perceived objects plus compatibility region entries.

New callers should call list_regions for full region geometry and staleness. Use get_scene_graph only when object relationships are needed. Contract: robonix/system/scene/list_objects.

async scene_service.mcp_tools.list_regions(_req: ListRegions_Request) → ListRegions_Response[source]

Return every registered region with its stable goal_region ID.

Perceived physical objects are intentionally excluded. Stale annotations remain visible and are marked explicitly so callers never infer absence from a hidden or incomplete region list. Contract: robonix/system/scene/list_regions.

async scene_service.mcp_tools.list_relations(req: ListRelations_Request) → ListRelations_Response[source]

List scene graph edges, optionally filtered by relation type. Pass empty relation string to get all edges. Contract: robonix/system/scene/list_relations.