|
9 | 9 |
|
10 | 10 | from pydantic import PydanticSchemaGenerationError |
11 | 11 |
|
| 12 | + |
| 13 | +# tools we don't want enabled at all. |
| 14 | +# they simply don't work well in an AI context. |
12 | 15 | _DEFAULT_IGNORE = { |
13 | 16 | "data_wait_asset", |
14 | 17 | "orders_wait", |
|
22 | 25 | "destinations_patch_destination", |
23 | 26 | } |
24 | 27 |
|
| 28 | +SDK_CLIENTS = [ |
| 29 | + (planet.FeaturesClient, "features"), |
| 30 | + (planet.DataClient, "data"), |
| 31 | + (planet.OrdersClient, "orders"), |
| 32 | + (planet.SubscriptionsClient, "subscriptions"), |
| 33 | + (planet.MosaicsClient, "mosaics"), |
| 34 | + (planet.DestinationsClient, "destinations"), |
| 35 | +] |
| 36 | + |
25 | 37 |
|
26 | 38 | def mcp() -> FastMCP: |
27 | 39 | mcp = FastMCP("sdk") |
28 | | - make_tools(mcp, planet.FeaturesClient, "features") |
29 | | - make_tools(mcp, planet.DataClient, "data") |
30 | | - make_tools(mcp, planet.OrdersClient, "orders") |
31 | | - make_tools(mcp, planet.SubscriptionsClient, "subscriptions") |
32 | | - make_tools(mcp, planet.MosaicsClient, "mosaics") |
33 | | - make_tools(mcp, planet.DestinationsClient, "destinations") |
| 40 | + for client, prefix in SDK_CLIENTS: |
| 41 | + make_tools(mcp, client, prefix) |
34 | 42 | return mcp |
35 | 43 |
|
36 | 44 |
|
@@ -61,8 +69,16 @@ def make_tools(mcp: FastMCP, client_class: type, prefix: str): |
61 | 69 | if sig.return_annotation is None: |
62 | 70 | func = _return_wrapper(func) |
63 | 71 |
|
64 | | - if "download" in name: |
65 | | - opts["tags"] = set("download") |
| 72 | + opts["tags"] = set() |
| 73 | + |
| 74 | + for tag in ["download", "patch", "update"]: |
| 75 | + if tag in name: |
| 76 | + opts["tags"].add(tag) |
| 77 | + |
| 78 | + # add tags based on sdk client |
| 79 | + for _, tag in SDK_CLIENTS: |
| 80 | + if tag in full_name: |
| 81 | + opts["tags"].add(tag) |
66 | 82 |
|
67 | 83 | try: |
68 | 84 | mcp.tool(func, name=full_name, **opts) |
|
0 commit comments