Skip to main content
Glama
TitanmindAGI

Titanmind WhatsApp MCP

by TitanmindAGI

register_msg_template_for_approval

Create and submit WhatsApp message templates for approval, enabling structured messaging with customizable components like headers, body text, and interactive buttons.

Instructions

creates and registers a new whatsapp message template for approval.
Args:
    template_name (str): name of the whatsapp message template, It only accepts a single word without no special characters except underscores
    language (str): language of the whatsapp message template (default is "en")
    category (str): category of the whatsapp message template (default is "MARKETING"), other possible values are "UTILITY", "AUTHENTICATION"
    message_content_components (dict): the message content that needs to be sent. It needs to be structured like the below example, 
    components are required to have BODY component at least, like this: {"type": "BODY", "text": "lorem body text"}, BODY component is for the simple text.
    All other components are optional. 
    HEADER component can have any of the below format, but only one format at a time can be used.: TEXT(the header component with TEXT needs to be like this
    {
    "type": "HEADER",
    "format": "TEXT",
    "text": "lorem header text"
    }
    ), VIDEO(the header component with VIDEO needs to be like this
    {
     "type":"HEADER",
     "format":"VIDEO",
     "example":{
        "header_handle":[
           "https://sample_video_url.jpg"
        ]
     }
    }
    )
    , IMAGE(the header component with IMAGE needs to be like this 
    {
     "type":"HEADER",
     "format":"IMAGE",
     "example":{
        "header_handle":[
           "https://sample_image_url.jpg"
        ]
     }
    }),
   DOCUMENT (the header component with DOCUMENT needs to be like this 
    {
     "type":"HEADER",
     "format":"DOCUMENT",
     "example":{
        "header_handle":[
           "https://sample_document_url"
        ]
     }
  }),
    message_content_components value with all other type of components is mentioned below.
        [
                {
                    "type": "HEADER",
                    "format": "TEXT",
                    "text": "lorem header text"
                },
                {
                    "type": "BODY",
                    "text": "lorem body text"
                },
                {
                    "type": "FOOTER",
                    "text": "lorem footer text"
                },
                {
                    "type": "BUTTONS",
                    "buttons": [
                        {
                            "type": "QUICK_REPLY",
                            "text": "lorem reply bt"
                        },
                        {
                          "type": "URL",
                          "text": "cta",
                          "url": "https:sample.in"
                        },
                        {
                          "type": "PHONE_NUMBER",
                          "text": "call ",
                          "phone_number": "IN328892398"
                        }
                    ]
                }
            ]
    Buttons need to follow order of first QUICK_REPLY, then URL, and then PHONE_NUMBER.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
template_nameYes
message_content_componentsYes
languageNoen
categoryNoMARKETING

Implementation Reference

  • The core handler function that executes the logic to register a WhatsApp message template for approval by making a POST request to the API endpoint.
    def register_msg_template_for_approval(
            template_name: str, language: str, category: str, message_content_components: list[dict[str, Any]]
    ):
        return asdict(
            TitanMindAPINetworking().make_request(
                endpoint=f"whatsapp/template/",
                payload={
                    "name": template_name,
                    "language": language,
                    "category": category,
                    "components": message_content_components
                },
                success_message="whatsapp template registered for approval.",
                method=HTTPMethod.POST,
            )
        )
  • The MCP tool registration using the @mcp.tool() decorator. Includes the function signature, detailed docstring describing input schema and usage, and delegates to the core handler.
    @mcp.tool()
    def register_msg_template_for_approval(
            template_name: str,
            message_content_components: list[dict[str, Any]],
            language: str = "en", category: str = "MARKETING",
    ) -> Optional[Dict[str, Any]]:
        """
        creates and registers a new whatsapp message template for approval.
        Args:
            template_name (str): name of the whatsapp message template, It only accepts a single word without no special characters except underscores
            language (str): language of the whatsapp message template (default is "en")
            category (str): category of the whatsapp message template (default is "MARKETING"), other possible values are "UTILITY", "AUTHENTICATION"
            message_content_components (dict): the message content that needs to be sent. It needs to be structured like the below example, 
            components are required to have BODY component at least, like this: {"type": "BODY", "text": "lorem body text"}, BODY component is for the simple text.
            All other components are optional. 
            HEADER component can have any of the below format, but only one format at a time can be used.: TEXT(the header component with TEXT needs to be like this
            {
            "type": "HEADER",
            "format": "TEXT",
            "text": "lorem header text"
            }
            ), VIDEO(the header component with VIDEO needs to be like this
            {
             "type":"HEADER",
             "format":"VIDEO",
             "example":{
                "header_handle":[
                   "https://sample_video_url.jpg"
                ]
             }
            }
            )
            , IMAGE(the header component with IMAGE needs to be like this 
            {
             "type":"HEADER",
             "format":"IMAGE",
             "example":{
                "header_handle":[
                   "https://sample_image_url.jpg"
                ]
             }
            }),
           DOCUMENT (the header component with DOCUMENT needs to be like this 
            {
             "type":"HEADER",
             "format":"DOCUMENT",
             "example":{
                "header_handle":[
                   "https://sample_document_url"
                ]
             }
          }),
            message_content_components value with all other type of components is mentioned below.
                [
                        {
                            "type": "HEADER",
                            "format": "TEXT",
                            "text": "lorem header text"
                        },
                        {
                            "type": "BODY",
                            "text": "lorem body text"
                        },
                        {
                            "type": "FOOTER",
                            "text": "lorem footer text"
                        },
                        {
                            "type": "BUTTONS",
                            "buttons": [
                                {
                                    "type": "QUICK_REPLY",
                                    "text": "lorem reply bt"
                                },
                                {
                                  "type": "URL",
                                  "text": "cta",
                                  "url": "https:sample.in"
                                },
                                {
                                  "type": "PHONE_NUMBER",
                                  "text": "call ",
                                  "phone_number": "IN328892398"
                                }
                            ]
                        }
                    ]
            Buttons need to follow order of first QUICK_REPLY, then URL, and then PHONE_NUMBER.
        """
    
        return titan_mind_functions.register_msg_template_for_approval(
            template_name, language, category, message_content_components
        )
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It implies a write operation ('creates and registers') and mentions approval, suggesting a multi-step process. However, it lacks details on permissions, rate limits, error handling, or what 'for approval' entails (e.g., pending state, review timeline). Some behavioral context is given but incomplete for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is overly verbose and poorly structured. It repeats information (e.g., HEADER formats listed multiple times), includes lengthy JSON examples inline, and lacks clear sectioning. While comprehensive, it's not efficiently organized, making it harder to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, 0% schema coverage, no output schema, and 4 parameters (2 required), the description does well on parameter semantics but lacks other context. It covers what the tool does and input details but misses behavioral aspects (e.g., response format, errors) and usage guidelines. For a mutation tool with this complexity, it's partially complete but has gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate fully. It provides extensive semantic details for all 4 parameters: template_name constraints (single word, underscores allowed), language default, category options, and detailed structure for message_content_components with examples and rules (e.g., BODY required, HEADER formats, BUTTONS order). This adds significant value beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'creates and registers a new whatsapp message template for approval.' It specifies the verb ('creates and registers'), resource ('whatsapp message template'), and outcome ('for approval'). However, it doesn't differentiate from sibling tools like 'get_the_templates' or 'send_msg_to_multiple_num_using_approved_template', which would require a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., approval workflows), compare with sibling tools, or specify contexts where this is appropriate versus other messaging tools. Usage is implied only by the purpose statement.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TitanmindAGI/titanmind-whatsapp-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server