Skip to main content
Glama

get_resource_download_formats

Retrieve specific resource formats by providing a resource ID and desired format. This tool enables precise downloads of photos, videos, or PSD files from the Freepik FastMCP Toolkit.

Instructions

Retrieve a resource by specifying both the resource ID and the format. This endpoint allows for precise downloading of resources in the desired format.

Path Parameters:

  • resource-id (Required): Photo, video or PSD resource ID

  • resource-format (Required): Resource format

Responses:

  • 200 (Success): OK

    • Content-Type: application/json

    • Response Properties:

    • Example:

{ "data": [ { "signed_url": "https://img.freepik.com/premium-photo/close-up-cat-resting_1048944-9269194.jpg?t=st=1725276607~exp=1725280207~hmac=1538f1b294fc3a19a19e9f02ceeb6594a9a1e36a900de85d47bbd386e27dddbe", "filename": "blackboard-template.zip", "url": "https://downloadscdn5.freepik.com/d/1137445/blackboard-template.zip" }, { "signed_url": "https://img.freepik.com/premium-photo/close-up-cat-resting_1048944-9269194.jpg?t=st=1725276607~exp=1725280207~hmac=1538f1b294fc3a19a19e9f02ceeb6594a9a1e36a900de85d47bbd386e27dddbe", "filename": "blackboard-template.zip", "url": "https://downloadscdn5.freepik.com/d/1137445/blackboard-template.zip" } ] }
  • 400: Bad Request - The server could not understand the request due to invalid syntax.

    • Content-Type: application/json

    • Response Properties:

    • Example:

{ "message": "message" }
  • 401: Unauthorized - The client must authenticate itself to get the requested response.

    • Content-Type: application/json

    • Response Properties:

    • Example:

{ "message": "message" }
  • 403: Forbidden - The client does not have permission to access the requested resource.

    • Content-Type: application/json

    • Response Properties:

    • Example:

{ "message": "message" }
  • 404: Not Found - The server can not find the requested resource.

    • Content-Type: application/json

    • Response Properties:

    • Example:

{ "message": "message" }
  • 429: Too Many Requests - The client has sent too many requests in a given amount of time.

    • Content-Type: application/json

    • Response Properties:

    • Example:

{ "message": "message" }
  • 500: Internal Server Error - The server has encountered a situation it doesn't know how to handle.

    • Content-Type: application/json

    • Response Properties:

    • Example:

{ "message": "Internal Server Error" }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
resource-formatYesResource format
resource-idYesPhoto, video or PSD resource ID

Implementation Reference

  • Registers the MCP tools from Freepik OpenAPI specification using FastMCP.from_openapi, including the 'get_resource_download_formats' tool via the /v1/resource.* route map.
    server = FastMCP.from_openapi( openapi_spec=openapi_spec, client=http_client, name=server_config.name, route_maps=route_maps, mcp_component_fn=mcp_component_fn, )
  • Configures the route map to expose all /v1/resource.* endpoints as MCP tools, which includes the get_resource_download_formats endpoint.
    RouteMap( methods=[ "GET", "POST", ], pattern=r"/v1/resource.*", mcp_type=MCPType.TOOL, ),
  • Loads the OpenAPI specification from Freepik API that defines the input/output schema and operationId for the get_resource_download_formats tool.
    def load_spec(self) -> dict[str, Any]: """ Load OpenAPI spec with caching. Returns: Dict containing the OpenAPI specification. Raises: Exception: If unable to load the specification. """ cached_spec = self._load_from_cache() if cached_spec is not None: return cached_spec return self._download_and_cache_spec()
  • Prepares the OpenAPI spec and route maps used to register the tools, including get_resource_download_formats.
    spec_loader = OpenApiSpecLoader(cache_config) openapi_spec = spec_loader.load_spec() # Get route configuration route_maps = RouteConfiguration.get_route_maps()

Other Tools

Related 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/freepik-company/freepik-mcp'

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