recommend_templates
Suggests official video templates by analyzing video mode and optional search criteria to help users find appropriate starting points for video creation.
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-228 (handler)The main handler function for the 'recommend_templates' tool. It takes TemplateRecommendationArgs, calls nolang_api.recommend_template, processes the response into TemplateSummary objects, and returns a 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)Registration of the 'recommend_templates' tool using the FastMCP @mcp.tool decorator, specifying the 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 model defining the input arguments for the 'recommend_templates' tool: video_mode (required), query (optional), is_mobile_format (optional).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 model defining the output result for the 'recommend_templates' tool: a list of TemplateSummary objects.class TemplateRecommendationResult(BaseModel): model_config = ConfigDict(extra="allow") templates: List[TemplateSummary] = Field(..., description="List of recommended template summaries")