manus_file_delete
Delete a file manually from Manus. Files auto-delete after 48 hours, but you can remove them sooner to free up space or remove sensitive data.
Instructions
Delete a file. Files auto-delete 48 hours after upload, so manual deletion is optional.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_id | Yes |
Implementation Reference
- manus_mcp/tools/files.py:52-67 (handler)The actual handler function for the manus_file_delete tool. Decorated with @manus_tool, it makes a POST request to /v2/file.delete with the provided FileDeleteRequest and returns a FileDeleteResponse.
@manus_tool( name="manus_file_delete", description=( "Delete a file. Files auto-delete 48 hours after upload, so manual deletion is optional." ), input_schema=FileDeleteRequest, output_schema=FileDeleteResponse, ) async def file_delete(req: FileDeleteRequest, ctx: ToolCtx) -> FileDeleteResponse: return await ctx.client.call( "POST", "/v2/file.delete", json_body=req, response_model=FileDeleteResponse, rate_limit_key="file.delete", ) - manus_mcp/schemas/files.py:44-45 (schema)Input schema for the manus_file_delete tool, requiring a file_id string.
class FileDeleteRequest(ManusModel): file_id: str - manus_mcp/schemas/files.py:48-49 (schema)Output schema for the manus_file_delete tool, extending ResponseEnvelope (contains ok and request_id fields).
class FileDeleteResponse(ResponseEnvelope): pass - manus_mcp/tools/files.py:52-67 (registration)The @manus_tool decorator registers the tool with name='manus_file_delete' in the global _REGISTRY dict (defined in registry.py).
@manus_tool( name="manus_file_delete", description=( "Delete a file. Files auto-delete 48 hours after upload, so manual deletion is optional." ), input_schema=FileDeleteRequest, output_schema=FileDeleteResponse, ) async def file_delete(req: FileDeleteRequest, ctx: ToolCtx) -> FileDeleteResponse: return await ctx.client.call( "POST", "/v2/file.delete", json_body=req, response_model=FileDeleteResponse, rate_limit_key="file.delete", ) - manus_mcp/tools/registry.py:39-80 (registration)The registry infrastructure that stores all tools. The @manus_tool decorator calls _REGISTRY[name] = ToolDef(...) to register each tool, accessible via all_tools().
_REGISTRY: dict[str, ToolDef[Any, Any]] = {} def manus_tool( *, name: str, description: str, input_schema: type[TIn], output_schema: type[TOut], rate_limit_key: str | None = None, ) -> Callable[ [Callable[[TIn, ToolCtx], Awaitable[TOut]]], Callable[[TIn, ToolCtx], Awaitable[TOut]] ]: """Decorator registering `handler` as a tool with the given metadata.""" def wrap( handler: Callable[[TIn, ToolCtx], Awaitable[TOut]], ) -> Callable[[TIn, ToolCtx], Awaitable[TOut]]: if name in _REGISTRY: raise RuntimeError(f"Duplicate tool name: {name}") _REGISTRY[name] = ToolDef( name=name, description=description, input_schema=input_schema, output_schema=output_schema, handler=handler, rate_limit_key=rate_limit_key, ) return handler return wrap def all_tools() -> list[ToolDef[Any, Any]]: """Return a stable-ordered copy of every registered tool.""" return sorted(_REGISTRY.values(), key=lambda t: t.name) def clear_registry() -> None: """Test helper.""" _REGISTRY.clear()