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
| Name | Required | Description | Default |
|---|---|---|---|
| args | Yes |
Implementation Reference
- nolang_mcp/server.py:209-229 (handler)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
- nolang_mcp/server.py:205-208 (registration)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.", )
- nolang_mcp/models.py:249-266 (schema)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", )
- nolang_mcp/models.py:362-366 (schema)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")
- nolang_mcp/models.py:354-360 (schema)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")