list_generated_videos
Retrieve a paginated list of AI-generated videos created through the NoLang API for easy management and access to your video content.
Instructions
Return a paginated list of videos you have generated.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | Yes |
Implementation Reference
- nolang_mcp/server.py:163-177 (handler)The handler function that executes the list_generated_videos tool logic, fetching videos via API and formatting results.async def list_generated_videos(args: ListVideosArgs) -> ListVideosResult: try: response = await nolang_api.list_videos(args.page) summaries = [ VideoSummary(video_id=v.video_id, created_at=v.created_at, prompt=v.prompt or "") for v in response.results ] return ListVideosResult( total_videos=response.total_count, page=args.page, has_next=response.has_next, videos=summaries, ) except httpx.HTTPStatusError as e: raise RuntimeError(format_http_error(e)) from e
- nolang_mcp/server.py:159-162 (registration)Registers the list_generated_videos tool in the FastMCP server.@mcp.tool( name="list_generated_videos", description="Return a paginated list of videos you have generated.", )
- nolang_mcp/models.py:286-292 (schema)Pydantic schema for input arguments to the list_generated_videos tool.class ListVideosArgs(BaseModel): """Arguments for listing videos.""" model_config = ConfigDict(extra="forbid") page: int = Field(default=1, description="Page number to retrieve", ge=1)
- nolang_mcp/models.py:327-334 (schema)Pydantic schema for the output result of the list_generated_videos tool.class ListVideosResult(BaseModel): model_config = ConfigDict(extra="allow") total_videos: int = Field(..., description="Total number of videos matching the criteria") page: int = Field(..., description="Current page number") has_next: bool = Field(..., description="True if there is another page of results") videos: List[VideoSummary] = Field(..., description="List of video summaries")
- nolang_mcp/api_client.py:207-209 (helper)Helper method in NoLangAPI client that retrieves the paginated list of generated videos from the API.async def list_videos(self, page: int = 1) -> VideoListResponse: response_data = await self._get("/videos/", params={"page": page}) return VideoListResponse(**response_data)