You can just shove the query pipeline into a function tool
from llama_index.core.tools import FunctionTool
def query(inp: str) -> str:
"""Useful for answering questions about X."""
output = pipeline.run(...)
return str(output['response'])
tool = FunctionTool.from_defaults(fn=query)
Here the function name and docstring are used as the tool name and tool description
You can also go much more low-level, in this notebook example
https://docs.llamaindex.ai/en/stable/examples/agent/agent_runner/query_pipeline_agent/?h=query+pipeline+tool