libentry 1.24__py3-none-any.whl → 1.24.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
libentry/mcp/service.py CHANGED
@@ -594,24 +594,26 @@ class ToolsService:
594
594
  tools = []
595
595
  for name, route in self.get_tool_routes().items():
596
596
  api_info = route.api_info
597
+ api_models = route.fn if isinstance(route.fn, APISignature) else get_api_signature(route.fn)
598
+ args_model = api_models.input_model or api_models.bundled_model
597
599
  tool = Tool(
598
600
  name=api_info.name,
599
601
  description=api_info.description,
600
- inputSchema=ToolSchema()
602
+ inputSchema=ToolSchema.model_validate(args_model.model_json_schema())
601
603
  )
602
604
  tools.append(tool)
603
- schema = query_api(route.fn)
604
- input_schema = schema.context[schema.input_schema]
605
- for field in input_schema.fields:
606
- type_ = field.type
607
- if isinstance(type_, List):
608
- type_ = "|".join(type_)
609
- tool.inputSchema.properties[field.name] = ToolProperty(
610
- type=type_,
611
- description=field.description
612
- )
613
- if field.is_required:
614
- tool.inputSchema.required.append(field.name)
605
+ # schema = query_api(route.fn)
606
+ # input_schema = schema.context[schema.input_schema]
607
+ # for field in input_schema.fields:
608
+ # type_ = field.type
609
+ # if isinstance(type_, List):
610
+ # type_ = "|".join(type_)
611
+ # tool.inputSchema.properties[field.name] = ToolProperty(
612
+ # type=type_,
613
+ # description=field.description
614
+ # )
615
+ # if field.is_required:
616
+ # tool.inputSchema.required.append(field.name)
615
617
  return ListToolsResult(tools=tools)
616
618
 
617
619
  @api.route("/tools/call")
libentry/mcp/types.py CHANGED
@@ -312,6 +312,9 @@ class ToolAnnotations(BaseModel):
312
312
 
313
313
  class ToolProperty(BaseModel):
314
314
  type: Optional[str] = None
315
+ anyOf: Optional[List["ToolProperty"]] = None
316
+ items: Optional["ToolProperty"] = None
317
+ additionalProperties: Optional["ToolProperty"] = None
315
318
  description: Optional[str] = None
316
319
 
317
320
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: libentry
3
- Version: 1.24
3
+ Version: 1.24.2
4
4
  Summary: Entries for experimental utilities.
5
5
  Home-page: https://github.com/XoriieInpottn/libentry
6
6
  Author: xi
@@ -13,8 +13,8 @@ libentry/utils.py,sha256=O7P6GadtUIjq0N2IZH7PhHZDUM3NebzcqyDqytet7CM,683
13
13
  libentry/mcp/__init__.py,sha256=1oLL20yLB1GL9IbFiZD8OReDqiCpFr-yetIR6x1cNkI,23
14
14
  libentry/mcp/api.py,sha256=KSvz6_TNGKQQoFJPNH1XIc8CMji0I2_CqC9VCSOPRfc,2491
15
15
  libentry/mcp/client.py,sha256=tEJbMpXiMKQ0qDgLGyavE2A4jpoXliqbrVj_TMfOGXI,22488
16
- libentry/mcp/service.py,sha256=VBacwSN9xiV3wk5Ta0LHxRAor1cwR04ZavlKLTdTuWw,34721
17
- libentry/mcp/types.py,sha256=xTQCnKAgeJNss4klJ33MrWHGCzG_LeR3urizO_Z9q9U,12239
16
+ libentry/mcp/service.py,sha256=qA6I9Mi-eudRYwVGhff1_aAImK424bhASlsWaHP8XNI,34971
17
+ libentry/mcp/types.py,sha256=aAoVO4jjqEvDzNneuZapmRYonLLnGsbcLoypVyRNNYg,12389
18
18
  libentry/service/__init__.py,sha256=1oLL20yLB1GL9IbFiZD8OReDqiCpFr-yetIR6x1cNkI,23
19
19
  libentry/service/common.py,sha256=OVaW2afgKA6YqstJmtnprBCqQEUZEWotZ6tHavmJJeU,42
20
20
  libentry/service/flask.py,sha256=2egCFFhRAfLpmSyibgaJ-3oexI-j27P1bmaPEn-hSlc,13817
@@ -22,10 +22,10 @@ libentry/service/list.py,sha256=ElHWhTgShGOhaxMUEwVbMXos0NQKjHsODboiQ-3AMwE,1397
22
22
  libentry/service/running.py,sha256=FrPJoJX6wYxcHIysoatAxhW3LajCCm0Gx6l7__6sULQ,5105
23
23
  libentry/service/start.py,sha256=mZT7b9rVULvzy9GTZwxWnciCHgv9dbGN2JbxM60OMn4,1270
24
24
  libentry/service/stop.py,sha256=wOpwZgrEJ7QirntfvibGq-XsTC6b3ELhzRW2zezh-0s,1187
25
- libentry-1.24.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
26
- libentry-1.24.dist-info/METADATA,sha256=zvGz_iBvBEMl_1HH4odL37ySnpBaLTTo7dAsxdwNrB4,1133
27
- libentry-1.24.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
28
- libentry-1.24.dist-info/entry_points.txt,sha256=1v_nLVDsjvVJp9SWhl4ef2zZrsLTBtFWgrYFgqvQBgc,61
29
- libentry-1.24.dist-info/top_level.txt,sha256=u2uF6-X5fn2Erf9PYXOg_6tntPqTpyT-yzUZrltEd6I,9
30
- libentry-1.24.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
31
- libentry-1.24.dist-info/RECORD,,
25
+ libentry-1.24.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
26
+ libentry-1.24.2.dist-info/METADATA,sha256=-cTLJ9bOea34jvdvzOGMDUKaFaNCkl13WMJgl2jtn7g,1135
27
+ libentry-1.24.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
28
+ libentry-1.24.2.dist-info/entry_points.txt,sha256=1v_nLVDsjvVJp9SWhl4ef2zZrsLTBtFWgrYFgqvQBgc,61
29
+ libentry-1.24.2.dist-info/top_level.txt,sha256=u2uF6-X5fn2Erf9PYXOg_6tntPqTpyT-yzUZrltEd6I,9
30
+ libentry-1.24.2.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
31
+ libentry-1.24.2.dist-info/RECORD,,