Skip to main content

Module tools

Module tools 

Source
Available on crate feature mcp and non-WebAssembly only.
Expand description

The ECS tools: reading and writing a world’s entities and components.

These tools need nothing but the world itself, so they live next to it and register themselves with the MCP server through ToolSource.

Re-exportsΒ§

use rmcp::ErrorData; πŸ”’
use rmcp::model::CallToolResult; πŸ”’
use rmcp::model::ContentBlock; πŸ”’
use serde_json::Value; πŸ”’
use crate::mcp::host::Despawned; πŸ”’
use crate::mcp::host::McpCommand; πŸ”’
use crate::mcp::host::Output; πŸ”’
use crate::mcp::host::SpawnedEntity; πŸ”’
use crate::mcp::host::to_value; πŸ”’
use crate::mcp::server::CommandSender; πŸ”’
use crate::mcp::server::EntityArg; πŸ”’
use crate::mcp::server::GetComponent; πŸ”’
use crate::mcp::server::ListEntities; πŸ”’
use crate::mcp::server::McpServer; πŸ”’
use crate::mcp::server::NoArgs; πŸ”’
use crate::mcp::server::SetComponent; πŸ”’
use crate::mcp::server::SpawnEntity; πŸ”’
use crate::mcp::server::ToolResult; πŸ”’
use crate::mcp::server::ToolRouter; πŸ”’
use crate::mcp::server::ToolSource; πŸ”’
use crate::mcp::server::WorldArg; πŸ”’
use crate::mcp::server::command; πŸ”’
use crate::mcp::server::entity; πŸ”’
use crate::mcp::server::tool; πŸ”’
use crate::reflect; πŸ”’
use crate::DynamicBundle; πŸ”’
use crate::Entity; πŸ”’
use crate::Scope; πŸ”’
use crate::ScopeMut; πŸ”’
use crate::World; πŸ”’

FunctionsΒ§

component_names πŸ”’
The component names the reflection table holds.
despawn_entity πŸ”’
Despawn one entity.
despawn_one πŸ”’
Despawn one entity and its subtree.
get_component πŸ”’
One component of one entity.
get_entity πŸ”’
One entity’s component names and location.
list_archetypes πŸ”’
Every archetype with its component names and length.
list_components πŸ”’
The component names the server can read and write.
list_entities πŸ”’
Every spawned entity with its component names.
list_worlds πŸ”’
Every world the host carries.
read_component πŸ”’
One component of one entity, encoded.
register πŸ”’
Register every ECS tool on router.
scoped πŸ”’
The scope an ECS tool runs in: the scope the arguments name, or the root.
scoped_mut πŸ”’
The mutable scope an ECS tool runs in.
set_component πŸ”’
Overwrite one component of one entity.
spawn_entity πŸ”’
Spawn an entity from a map of component name to value.
spawn_from_value πŸ”’
Spawn an entity from a map of component name to value.
summarize_archetypes πŸ”’
Every archetype with the component names it stores.
summarize_entities πŸ”’
Every spawned entity with its component names.
summarize_entity πŸ”’
One entity’s component names and location.
summarize_world πŸ”’
A high-level description of a scope.
world_summary πŸ”’
A high-level description of the world.
write_component πŸ”’
Overwrite one component of one entity.