You need to use tool validation for this. For custom Python script tool (that has two input parameters - string with filter value list and string with filter value list for feature layers in the currently open map document).

import arcpy
class ToolValidator(object):
"""Class for validating a tool's parameter values and controlling
the behavior of the tool's dialog."""
def __init__(self):
"""Setup arcpy and the list of tool parameters."""
self.params = arcpy.GetParameterInfo()
def initializeParameters(self):
"""Refine the properties of a tool's parameters. This method is
called when the tool is opened."""
return
def updateParameters(self):
"""Modify the values and properties of parameters before internal
validation is performed. This method is called whenever a parameter
has been changed."""
if self.params[0].value:
upd_list = []
mxd = arcpy.mapping.MapDocument(r"CURRENT")
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
for lyr in arcpy.mapping.ListLayers(mxd, "*{0}*".format(self.params[0].value), df):
upd_list.append(lyr.name)
self.params[1].filter.list = upd_list
return
def updateMessages(self):
"""Modify the messages created by internal validation for each tool
parameter. This method is called after internal validation."""
return
For Python toolbox tool:
class FilterLayerNameTool(object):
def __init__(self):
"""Define the tool (tool name is the name of the class)."""
self.label = "FilterLayerNameTool"
self.description = "FilterLayerNameTool"
self.canRunInBackground = False
def getParameterInfo(self):
"""Define parameter definitions"""
in_filter = arcpy.Parameter(
displayName="Input filter word",
name="in_filter",
datatype="GPString",
parameterType="Required",
direction="Input")
in_filter.filter.type = "ValueList"
in_filter.filter.list = ["Boundary","Border"]
in_fc = arcpy.Parameter(
displayName="Input Features",
name="in_features",
datatype="GPString",
parameterType="Optional",
direction="Input")
in_fc.filter.type = "ValueList"
in_fc.filter.list = []
parameters = [in_filter,in_fc]
return parameters
def isLicensed(self):
"""Set whether tool is licensed to execute."""
return True
def updateParameters(self, parameters):
"""Modify the values and properties of parameters before internal
validation is performed. This method is called whenever a parameter
has been changed."""
if parameters[0].value:
upd_list = []
mxd = arcpy.mapping.MapDocument(r"CURRENT")
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
for lyr in arcpy.mapping.ListLayers(mxd, "*{0}*".format(parameters[0].value), df):
upd_list.append(lyr.name)
parameters[1].filter.list = upd_list
return
def updateMessages(self, parameters):
"""Modify the messages created by internal validation for each tool
parameter. This method is called after internal validation."""
return
def execute(self, parameters, messages):
"""The source code of the tool."""
return
tool-validation
you are likely to attract the audience that is most skilled in that area.