Documentation Index
Fetch the complete documentation index at: https://mintlify.com/code-and-relax/robloxstudio-mcp/llms.txt
Use this file to discover all available pages before exploring further.
Add Tag
Add a CollectionService tag to a Roblox instance. Tags are string labels used to categorize instances and query them efficiently.Parameters
Roblox instance path using dot notation (e.g.,
"game.Workspace.Part")Name of the tag to add (max 100 characters, case-sensitive)
Response
Returns confirmation object:Example Usage
Add Single Tag
Add Multiple Tags to One Instance
Batch Tag Multiple Instances
Conditional Tagging
Use Cases
Gameplay Systems
Tag instances to mark them as part of specific systems (weapons, enemies, interactables).AI Targeting
Tag objects that AI should interact with (patrol points, cover positions, objectives).Event Listeners
Use tags to identify instances that should respond to game events (destructible objects, flammable items).Team Assignment
Tag units with team affiliations for faction-based gameplay.Level Design
Mark spawn points, checkpoints, and triggers with tags for easy querying.CollectionService Integration
Tags integrate with Roblox’sCollectionService API:
Tag Naming Conventions
Best Practices
- Use PascalCase:
"RedTeam","HighDamage","Collectible" - Be descriptive:
"WeaponMelee"instead of"WM" - Use namespaces for systems:
"AI:Aggressive","System:Physics" - Avoid spaces:
"RedTeam"instead of"Red Team"
Common Tag Patterns
Idempotent Operation
Adding a tag that already exists does NOT throw an error:Workflow Example
Dynamic Tag System
Error Handling
- Throws error if
instancePathis invalid or instance doesn’t exist - Throws error if
tagNameexceeds 100 characters - Does NOT throw error if tag already exists (idempotent)
- Tag names are case-sensitive (
"Weapon"and"weapon"are different)
Related Tools
Get Tags
Get all tags on an instance
Remove Tag
Remove a tag from an instance
Get Tagged
Find all instances with a specific tag
Performance Considerations
- Adding tags is extremely fast (O(1) operation)
- Tags are indexed for efficient querying with
get_tagged - No performance penalty for having many tags on one instance
- Recommended for gameplay systems requiring fast categorization
Notes
- Tags are visible in Studio’s Properties panel under “Tags” section
- Tags replicate from server to client automatically
- Adding a tag fires
CollectionService.GetInstanceAddedSignal()in Lua - Tags persist when saving the game file
- One instance can have unlimited tags (practical limit ~100)
- Tags cannot contain special characters (stick to alphanumeric + underscore)