MCPcopy Index your code
hub / github.com/TaskingAI/TaskingAI / to_dict

Method to_dict

plugin/app/models/plugin.py:54–83  ·  view source on GitHub ↗
(self, lang: str)

Source from the content-addressed store, hash-verified

52 )
53
54 def to_dict(self, lang: str):
55 input_schema_dict = {
56 k: {
57 "type": v.type,
58 "name": i18n_text(self.bundle_id, v.name, lang),
59 "description": i18n_text(self.bundle_id, v.description, lang),
60 "required": v.required,
61 }
62 for k, v in self.input_schema.items()
63 }
64
65 output_schema_dict = {
66 k: {
67 "type": v.type,
68 "name": i18n_text(self.bundle_id, v.name, lang),
69 "description": i18n_text(self.bundle_id, v.description, lang),
70 "required": v.required,
71 }
72 for k, v in self.output_schema.items()
73 }
74
75 return {
76 "object": self.object_name(),
77 "bundle_id": self.bundle_id,
78 "plugin_id": self.plugin_id,
79 "name": i18n_text(self.bundle_id, self.name, lang),
80 "description": i18n_text(self.bundle_id, self.description, lang),
81 "input_schema": input_schema_dict,
82 "output_schema": output_schema_dict,
83 }
84
85 def validate_input(self, input_params: Dict[str, Any]):
86 # Iterate over the input_schema to validate each parameter

Callers

nothing calls this directly

Calls 2

object_nameMethod · 0.95
i18n_textFunction · 0.90

Tested by

no test coverage detected