MCPcopy Create free account
hub / github.com/TaskingAI/TaskingAI / to_dict

Method to_dict

backend/app/models/tool/plugin.py:102–134  ·  view source on GitHub ↗
(self, lang: str)

Source from the content-addressed store, hash-verified

100 )
101
102 def to_dict(self, lang: str):
103 from app.services.tool import i18n_text
104
105 input_schema_dict = {
106 k: {
107 "type": v.type,
108 "name": i18n_text(self.bundle_id, v.name, lang),
109 "description": i18n_text(self.bundle_id, v.description, lang),
110 "required": v.required,
111 }
112 for k, v in self.input_schema.items()
113 }
114
115 output_schema_dict = {
116 k: {
117 "type": v.type,
118 "name": i18n_text(self.bundle_id, v.name, lang),
119 "description": i18n_text(self.bundle_id, v.description, lang),
120 "required": v.required,
121 }
122 for k, v in self.output_schema.items()
123 }
124
125 return {
126 "object": self.object_name(),
127 "bundle_id": self.bundle_id,
128 "plugin_id": self.plugin_id,
129 "name": i18n_text(self.bundle_id, self.name, lang),
130 "description": i18n_text(self.bundle_id, self.description, lang),
131 "input_schema": input_schema_dict,
132 "output_schema": output_schema_dict,
133 "function_def": self.function_def,
134 }
135
136 def validate_input(self, input_params: Dict[str, Any]):
137 # 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