MCPcopy Index your code
hub / github.com/TaskingAI/TaskingAI / api_get_bundle_icon

Function api_get_bundle_icon

plugin/app/routes/image.py:18–38  ·  view source on GitHub ↗
(
        bundle_id: str,
        request: Request,
)

Source from the content-addressed store, hash-verified

16 responses={422: {"description": "Unprocessable Entity"}},
17)
18async def api_get_bundle_icon(
19 bundle_id: str,
20 request: Request,
21):
22 bundle = get_bundle(bundle_id)
23 if not bundle:
24 raise_http_error(
25 ErrorCode.OBJECT_NOT_FOUND,
26 message=f"bundle {bundle_id} not found.",
27 )
28
29 current_path = os.path.dirname(os.path.abspath(__file__))
30 png_file_path = f"../../bundles/{bundle_id}/resources/icon.png"
31 abs_png_file_path = os.path.join(current_path, png_file_path)
32
33 return FileResponse(
34 path=abs_png_file_path,
35 headers={"Content-Disposition": "inline"},
36 media_type="image/png",
37 filename=f"{bundle_id}.png",
38 )

Callers

nothing calls this directly

Calls 2

get_bundleFunction · 0.90
raise_http_errorFunction · 0.90

Tested by

no test coverage detected