Skip to main content

Tool Naming Convention

This document outlines the naming convention for tools in the ShotGrid MCP Server and provides guidelines for creating new tools.

MCP Tool Name Requirements

According to the Model Context Protocol (MCP) specification, tool names must follow these requirements:
  • Tool names must match the regular expression pattern: ^[a-zA-Z0-9_-]{1,64}$
  • This means tool names:
    • Can only contain letters, numbers, underscores, and hyphens
    • Cannot contain periods, spaces, or other special characters
    • Must be between 1 and 64 characters in length

ShotGrid MCP Server Tool Naming Convention

To maintain consistency and clarity, we follow these naming conventions for tools in the ShotGrid MCP Server:

Prefix-Based Naming

All tools should use a prefix that indicates their category:

Naming Structure

  • Use underscores to separate words in tool names
  • Use clear, descriptive names that indicate the tool’s purpose
  • Follow the pattern: [prefix]_[action]_[optional_qualifier]
  • Examples:
    • sg_find - Find entities using ShotGrid API
    • note_create - Create a note
    • playlist_add_versions - Add versions to a playlist
    • thumbnail_download - Download a thumbnail

Creating New Tools

When creating new tools for the ShotGrid MCP Server, follow these guidelines:

1. Choose the Appropriate Module

Place your tool in the appropriate module based on its functionality:
  • api_tools.py - Direct ShotGrid API wrappers
  • note_tools.py - Note-related tools
  • playlist_tools.py - Playlist-related tools
  • thumbnail_tools.py - Thumbnail-related tools
  • search_tools.py - Search-related tools
  • vendor_tools.py - Vendor-related tools
  • Create a new module if your tool doesn’t fit into existing categories

2. Define the Tool Function

3. Register the Tool

Tools are registered using the @server.tool() decorator. Make sure to:
  • Use a name that follows the naming convention
  • Provide proper type hints for parameters and return values
  • Include comprehensive docstrings
  • Implement proper error handling

4. Add Tests

Create tests for your tool in the appropriate test module:
  • Test normal operation
  • Test error conditions
  • Test edge cases

Examples

Basic Tool Example

Advanced Tool Example

Conclusion

Following these naming conventions and guidelines ensures that tools in the ShotGrid MCP Server are consistent, clear, and easy to use. It also helps maintain compatibility with the MCP specification and provides a better experience for users of the server.