Skip to main content
Glama
team-tissis

NoLang MCP Server

by team-tissis

recommend_templates

Find official templates for video creation by specifying video mode and optional search terms. Supports various formats including slideshows, audio, and query-based videos.

Instructions

Recommend official templates based on video mode and optional query.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsYes

Implementation Reference

  • The main handler function for the 'recommend_templates' tool. It takes TemplateRecommendationArgs, calls the nolang_api to recommend templates based on video_mode, query, and is_mobile_format, processes the response into TemplateSummary objects, and returns TemplateRecommendationResult.
    async def recommend_templates(
        args: TemplateRecommendationArgs,
    ) -> TemplateRecommendationResult:
        try:
            response = await nolang_api.recommend_template(
                args.video_mode,
                args.query or None,
                args.is_mobile_format if args.is_mobile_format else None,
            )
            templates = [
                TemplateSummary(
                    template_video_id=t.template_video_id,
                    title=t.title,
                    description=t.description or None,
                )
                for t in response.templates
            ]
            return TemplateRecommendationResult(templates=templates)
        except httpx.HTTPStatusError as e:
            raise RuntimeError(format_http_error(e)) from e
  • The @mcp.tool decorator that registers the recommend_templates handler function with the given name and description.
    @mcp.tool(
        name="recommend_templates",
        description="Recommend official templates based on video mode and optional query.",
    )
  • Pydantic schema for input arguments to the recommend_templates tool: video_mode (required VideoModeEnum), query (optional str), is_mobile_format (optional bool).
    class TemplateRecommendationArgs(BaseModel):
        """Arguments for getting template recommendations."""
    
        model_config = ConfigDict(extra="forbid")
    
        video_mode: VideoModeEnum = Field(
            ...,
            description="Target mode for template recommendations",
        )
        query: str = Field(
            default="",
            description="User input text for template recommendations",
        )
        is_mobile_format: bool = Field(
            default=False,
            description="Set to True to target mobile format templates",
        )
  • Pydantic schema for the output of the recommend_templates tool: list of TemplateSummary objects.
    class TemplateRecommendationResult(BaseModel):
        model_config = ConfigDict(extra="allow")
    
        templates: List[TemplateSummary] = Field(..., description="List of recommended template summaries")
  • Pydantic schema for individual template summaries returned in the result.
    class TemplateSummary(BaseModel):
        model_config = ConfigDict(extra="allow")
    
        template_video_id: UUID = Field(..., description="Unique identifier for the template video")
        title: str = Field(..., description="Title of the template video")
        description: Optional[str] = Field(None, description="Description of the template video")

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/team-tissis/nolang-mcp'

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