Spaces:
Running
Running
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def slice_list(lst: list, start: int, end: int) -> list:
|
| 4 |
+
"""
|
| 5 |
+
A tool that slices a list given a start and end index.
|
| 6 |
+
Args:
|
| 7 |
+
lst: The list to slice.
|
| 8 |
+
start: The start index.
|
| 9 |
+
end: The end index.
|
| 10 |
+
Returns:
|
| 11 |
+
The sliced list.
|
| 12 |
+
"""
|
| 13 |
+
return lst[start:end]
|
| 14 |
+
|
| 15 |
+
with gr.Blocks() as demo:
|
| 16 |
+
gr.Markdown(
|
| 17 |
+
"""
|
| 18 |
+
This is a demo of a MCP-only tool.
|
| 19 |
+
This tool slices a list.
|
| 20 |
+
This tool is MCP-only, so it does not have a UI.
|
| 21 |
+
"""
|
| 22 |
+
)
|
| 23 |
+
gr.api(
|
| 24 |
+
slice_list
|
| 25 |
+
)
|
| 26 |
+
|
| 27 |
+
_, url, _ = demo.launch(mcp_server=True)
|