Skip to content

Commit d46b0e6

Browse files
committed
docs: update CUSTOM_TOOLS.md with improved tool naming documentation and path corrections
- Clarified that the `name` argument in `@mcp_for_unity_tool` decorator is optional and defaults to the function name - Added documentation about using all FastMCP `mcp.tool` function decorator options - Updated class naming documentation to mention snake_case conversion by default - Corrected Python file path from `tools/screenshot_tool.py` to `UnityMcpServer~/src/tools/screenshot_tool.py` - Enhanced documentation for tool discovery and usage examples
1 parent 8173e01 commit d46b0e6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

docs/CUSTOM_TOOLS.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,13 @@ def my_custom_tool(
4747

4848
```python
4949
@mcp_for_unity_tool(
50-
name="custom_name", # Optional: override auto-generated name
50+
name="custom_name", # Optional: the function name is used by default
5151
description="Tool description", # Required: describe what the tool does
5252
)
5353
```
5454

55+
You can use all options available in FastMCP's `mcp.tool` function decorator: <https://gofastmcp.com/servers/tools#tools>. The `description` is the only required field.
56+
5557
### Auto-Discovery
5658

5759
Tools are automatically discovered when:
@@ -73,6 +75,7 @@ using MCPForUnity.Editor.Helpers;
7375

7476
namespace MyProject.Editor.CustomTools
7577
{
78+
// The name argument is optional, it uses a snake_case version of the class name by default
7679
[McpForUnityTool("my_custom_tool")]
7780
public static class MyCustomTool
7881
{
@@ -125,7 +128,7 @@ Tools are automatically discovered when:
125128

126129
## Complete Example: Custom Screenshot Tool
127130

128-
### Python (`tools/screenshot_tool.py`)
131+
### Python (`UnityMcpServer~/src/tools/screenshot_tool.py`)
129132

130133
```python
131134
from typing import Annotated, Any

0 commit comments

Comments
 (0)