improve logic a bit, cleanup
This commit is contained in:
@@ -270,7 +270,6 @@ def _remove_user_email_arg_from_docstring(docstring: str) -> str:
|
||||
|
||||
# Clean up any sequence of 3 or more newlines that might have been created
|
||||
modified_docstring = re.sub(r'\n{3,}', '\n\n', modified_docstring)
|
||||
|
||||
return modified_docstring
|
||||
|
||||
# Service configuration mapping
|
||||
@@ -523,7 +522,8 @@ def require_google_service(
|
||||
wrapper.__signature__ = wrapper_sig
|
||||
|
||||
# Conditionally modify docstring to remove user_google_email parameter documentation
|
||||
if os.getenv('MCP_REMOVE_USER_GOOGLE_EMAIL_ARG', False) == '1' and os.getenv('MCP_SINGLE_USER_MODE') != '1':
|
||||
if is_oauth21_enabled():
|
||||
logger.debug('OAuth 2.1 mode enabled, removing user_google_email from docstring')
|
||||
if func.__doc__:
|
||||
wrapper.__doc__ = _remove_user_email_arg_from_docstring(func.__doc__)
|
||||
|
||||
|
||||
@@ -774,7 +774,6 @@ async def inspect_doc_structure(
|
||||
|
||||
CRITICAL FOR TABLE OPERATIONS:
|
||||
ALWAYS call this BEFORE creating tables to get a safe insertion index.
|
||||
Look for "total_length" in the output - use values less than this for insertion.
|
||||
|
||||
WHAT THE OUTPUT SHOWS:
|
||||
- total_elements: Number of document elements
|
||||
|
||||
6
main.py
6
main.py
@@ -208,9 +208,9 @@ def main():
|
||||
# Check port availability before starting HTTP server
|
||||
try:
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
||||
s.settimeout(1.0) # Prevent hanging on bind
|
||||
s.bind(("0.0.0.0", port))
|
||||
except OSError:
|
||||
s.bind((socket.gethostbyname(""), port))
|
||||
except OSError as e:
|
||||
print(e)
|
||||
safe_print(f"❌ Port {port} is already in use. Cannot start HTTP server.")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user