MCPcopy Create free account
hub / github.com/modelscope/ms-agent / call_tool

Method call_tool

ms_agent/tools/code_server/lsp_code_server.py:631–643  ·  view source on GitHub ↗

Call a tool

(self, server_name: str, *, tool_name: str,
                        tool_args: dict)

Source from the content-addressed store, hash-verified

629 }
630
631 async def call_tool(self, server_name: str, *, tool_name: str,
632 tool_args: dict) -> str:
633 """Call a tool"""
634 if tool_name == 'check_directory':
635 return await self._check_directory(tool_args['directory'],
636 tool_args['language'])
637
638 elif tool_name == 'update_and_check':
639 return await self._update_and_check(tool_args['file_path'],
640 tool_args['content'],
641 tool_args['language'])
642 else:
643 return json.dumps({'error': f'Unknown tool: {tool_name}'})
644
645 async def _get_or_create_server(self,
646 language: str) -> Optional[LSPServer]:

Callers 1

_init_lsp_serversMethod · 0.95

Calls 2

_check_directoryMethod · 0.95
_update_and_checkMethod · 0.95

Tested by

no test coverage detected