@@ -591,9 +591,8 @@ def list_custom_source_definitions() -> list[dict[str, Any]]:
591591 {
592592 "definition_id" : d .definition_id ,
593593 "name" : d .name ,
594- "connector_type" : d .connector_type ,
595- "manifest" : d .manifest ,
596594 "version" : d .version ,
595+ "connector_builder_project_url" : d .connector_builder_project_url ,
597596 }
598597 for d in definitions
599598 ]
@@ -649,6 +648,39 @@ def update_custom_source_definition(
649648 )
650649
651650
651+ def permanently_delete_custom_source_definition (
652+ definition_id : Annotated [
653+ str ,
654+ Field (description = "The ID of the custom source definition to delete." ),
655+ ],
656+ ) -> str :
657+ """Permanently delete a custom YAML source definition from Airbyte Cloud.
658+
659+ IMPORTANT: This operation requires the connector name to either:
660+ 1. Start with "delete:" (case insensitive), OR
661+ 2. Contain "delete-me" (case insensitive)
662+
663+ If the connector does not meet these requirements, the deletion will be rejected with a
664+ helpful error message. Instruct the user to rename the connector appropriately to authorize
665+ the deletion.
666+
667+ Note: Only YAML (declarative) connectors are currently supported.
668+ Docker-based custom sources are not yet available.
669+ """
670+ workspace : CloudWorkspace = _get_cloud_workspace ()
671+ definition = workspace .get_custom_source_definition (
672+ definition_id = definition_id ,
673+ definition_type = "yaml" ,
674+ )
675+ definition_name : str = definition .name # Capture name before deletion
676+ definition .permanently_delete (
677+ safe_mode = True , # Hard-coded safe mode for extra protection when running in LLM agents.
678+ )
679+ return (
680+ f"Successfully deleted custom source definition '{ definition_name } ' (ID: { definition_id } )"
681+ )
682+
683+
652684def register_cloud_ops_tools (app : FastMCP ) -> None :
653685 """@private Register tools with the FastMCP app.
654686
@@ -668,3 +700,4 @@ def register_cloud_ops_tools(app: FastMCP) -> None:
668700 app .tool (publish_custom_source_definition )
669701 app .tool (list_custom_source_definitions )
670702 app .tool (update_custom_source_definition )
703+ app .tool (permanently_delete_custom_source_definition )
0 commit comments