'Returns dict of tool.'

def to_dict(self, trans, link_details=False, io_details=False):

    tool_dict = super(Tool, self).to_dict()
    tool_dict['edam_operations'] = self.edam_operations
    tool_dict['edam_topics'] = self.edam_topics
    if (hasattr(self, 'tool_shed') and self.tool_shed):
        tool_dict['tool_shed_repository'] = {'name': self.repository_name, 'owner': self.repository_owner, 'changeset_revision': self.changeset_revision, 'tool_shed': self.tool_shed}
    if trans.user_is_admin():
        tool_dict['config_file'] = os.path.abspath(self.config_file)
    if link_details:
        if (not isinstance(self, DataSourceTool)):
            link = url_for(controller='tool_runner', tool_id=self.id)
        else:
            link = url_for(controller='tool_runner', action='data_source_redirect', tool_id=self.id)
        tool_dict.update({'link': link, 'min_width': self.uihints.get('minwidth', (-1)), 'target': self.target})
    if io_details:
        tool_dict['inputs'] = [input.to_dict(trans) for input in self.inputs.values()]
        tool_dict['outputs'] = [output.to_dict(app=self.app) for output in self.outputs.values()]
    (tool_dict['panel_section_id'], tool_dict['panel_section_name']) = self.get_panel_section()
    tool_class = self.__class__
    regular_form = ((tool_class == Tool) or isinstance(self, DatabaseOperationTool))
    tool_dict['form_style'] = ('regular' if regular_form else 'special')
    return tool_dict
