"""Auto-generated MCP server from package 'requests'.

Generated by auto-mcp.
Modules analyzed: 17
Methods exposed: 149 tools, 0 resources, 0 prompts
"""

from typing import Any
from mcp.server.fastmcp import FastMCP

import requests
import requests.adapters
import requests.api
import requests.auth
import requests.cookies
import requests.help
import requests.hooks
import requests.models
import requests.sessions
import requests.structures
import requests.utils

# Create MCP server
mcp = FastMCP(name="requests-mcp-server")

# Tools

@mcp.tool(name="check_compatibility")
def check_compatibility(urllib3_version: Any, chardet_version: Any, charset_normalizer_version: Any):
    """Executes the check_compatibility operation."""
    return requests.check_compatibility(urllib3_version=urllib3_version, chardet_version=chardet_version, charset_normalizer_version=charset_normalizer_version)


@mcp.tool(name="SOCKSProxyManager")
def SOCKSProxyManager(*args: Any, **kwargs: Any):
    """Executes the SOCKSProxyManager operation."""
    return requests.adapters.SOCKSProxyManager(*args, **kwargs)


@mcp.tool(name="close")
def close():
    """Cleans up adapter specific items."""
    return requests.adapters.BaseAdapter.close()


@mcp.tool(name="send")
def send(request: Any, stream: Any = False, timeout: Any = None, verify: Any = True, cert: Any = None, proxies: Any = None):
    """Sends PreparedRequest object."""
    return requests.adapters.BaseAdapter.send(request=request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)


@mcp.tool(name="add_headers")
def add_headers(request: Any, **kwargs: Any):
    """Add any headers needed by the connection."""
    return requests.adapters.HTTPAdapter.add_headers(request=request, **kwargs)


@mcp.tool(name="build_connection_pool_key_attributes")
def build_connection_pool_key_attributes(request: Any, verify: Any, cert: Any = None):
    """Build the PoolKey attributes used by urllib3 to return a connection."""
    return requests.adapters.HTTPAdapter.build_connection_pool_key_attributes(request=request, verify=verify, cert=cert)


@mcp.tool(name="build_response")
def build_response(req: Any, resp: Any):
    """Builds a :class:`Response <requests."""
    return requests.adapters.HTTPAdapter.build_response(req=req, resp=resp)


@mcp.tool(name="cert_verify")
def cert_verify(conn: Any, url: Any, verify: Any, cert: Any):
    """Verify a SSL certificate."""
    return requests.adapters.HTTPAdapter.cert_verify(conn=conn, url=url, verify=verify, cert=cert)


@mcp.tool(name="close")
def close():
    """Disposes of any internal state."""
    return requests.adapters.HTTPAdapter.close()


@mcp.tool(name="get_connection")
def get_connection(url: Any, proxies: Any = None):
    """DEPRECATED: Users should move to `get_connection_with_tls_context`
for all subclasses of HTTPAdapter using Requests>=2."""
    return requests.adapters.HTTPAdapter.get_connection(url=url, proxies=proxies)


@mcp.tool(name="get_connection_with_tls_context")
def get_connection_with_tls_context(request: Any, verify: Any, proxies: Any = None, cert: Any = None):
    """Returns a urllib3 connection for the given request and TLS settings."""
    return requests.adapters.HTTPAdapter.get_connection_with_tls_context(request=request, verify=verify, proxies=proxies, cert=cert)


@mcp.tool(name="init_poolmanager")
def init_poolmanager(connections: Any, maxsize: Any, block: Any = False, **kwargs: Any):
    """Initializes a urllib3 PoolManager."""
    return requests.adapters.HTTPAdapter.init_poolmanager(connections=connections, maxsize=maxsize, block=block, **kwargs)


@mcp.tool(name="proxy_headers")
def proxy_headers(proxy: Any):
    """Returns a dictionary of the headers to add to any request sent
through a proxy."""
    return requests.adapters.HTTPAdapter.proxy_headers(proxy=proxy)


@mcp.tool(name="proxy_manager_for")
def proxy_manager_for(proxy: Any, **kwargs: Any):
    """Return urllib3 ProxyManager for the given proxy."""
    return requests.adapters.HTTPAdapter.proxy_manager_for(proxy=proxy, **kwargs)


@mcp.tool(name="request_url")
def request_url(request: Any, proxies: Any):
    """Obtain the url to use when making the final request."""
    return requests.adapters.HTTPAdapter.request_url(request=request, proxies=proxies)


@mcp.tool(name="send")
def send(request: Any, stream: Any = False, timeout: Any = None, verify: Any = True, cert: Any = None, proxies: Any = None):
    """Sends PreparedRequest object."""
    return requests.adapters.HTTPAdapter.send(request=request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)


@mcp.tool(name="delete")
def delete(url: Any, **kwargs: Any):
    """Sends a DELETE request."""
    return requests.api.delete(url=url, **kwargs)


@mcp.tool(name="get")
def get(url: Any, params: Any = None, **kwargs: Any):
    """Sends a GET request."""
    return requests.api.get(url=url, params=params, **kwargs)


@mcp.tool(name="head")
def head(url: Any, **kwargs: Any):
    """Sends a HEAD request."""
    return requests.api.head(url=url, **kwargs)


@mcp.tool(name="options")
def options(url: Any, **kwargs: Any):
    """Sends an OPTIONS request."""
    return requests.api.options(url=url, **kwargs)


@mcp.tool(name="patch")
def patch(url: Any, data: Any = None, **kwargs: Any):
    """Sends a PATCH request."""
    return requests.api.patch(url=url, data=data, **kwargs)


@mcp.tool(name="post")
def post(url: Any, data: Any = None, json: Any = None, **kwargs: Any):
    """Sends a POST request."""
    return requests.api.post(url=url, data=data, json=json, **kwargs)


@mcp.tool(name="put")
def put(url: Any, data: Any = None, **kwargs: Any):
    """Sends a PUT request."""
    return requests.api.put(url=url, data=data, **kwargs)


@mcp.tool(name="request")
def request(method: Any, url: Any, **kwargs: Any):
    """Constructs and sends a :class:`Request <Request>`."""
    return requests.api.request(method=method, url=url, **kwargs)


@mcp.tool(name="build_digest_header")
def build_digest_header(method: Any, url: Any):
    """:rtype: str."""
    return requests.auth.HTTPDigestAuth.build_digest_header(method=method, url=url)


@mcp.tool(name="handle_401")
def handle_401(r: Any, **kwargs: Any):
    """Takes the given response and tries digest-auth, if needed."""
    return requests.auth.HTTPDigestAuth.handle_401(r=r, **kwargs)


@mcp.tool(name="handle_redirect")
def handle_redirect(r: Any, **kwargs: Any):
    """Reset num_401_calls counter on redirects."""
    return requests.auth.HTTPDigestAuth.handle_redirect(r=r, **kwargs)


@mcp.tool(name="init_per_thread_state")
def init_per_thread_state():
    """Executes the init_per_thread_state operation."""
    return requests.auth.HTTPDigestAuth.init_per_thread_state()


@mcp.tool(name="cookiejar_from_dict")
def cookiejar_from_dict(cookie_dict: Any, cookiejar: Any = None, overwrite: Any = True):
    """Returns a CookieJar from a key/value dictionary."""
    return requests.cookies.cookiejar_from_dict(cookie_dict=cookie_dict, cookiejar=cookiejar, overwrite=overwrite)


@mcp.tool(name="create_cookie")
def create_cookie(name: Any, value: Any, **kwargs: Any):
    """Make a cookie from underspecified parameters."""
    return requests.cookies.create_cookie(name=name, value=value, **kwargs)


@mcp.tool(name="extract_cookies_to_jar")
def extract_cookies_to_jar(jar: Any, request: Any, response: Any):
    """Extract the cookies from the response into a CookieJar."""
    return requests.cookies.extract_cookies_to_jar(jar=jar, request=request, response=response)


@mcp.tool(name="get_cookie_header")
def get_cookie_header(jar: Any, request: Any):
    """Produce an appropriate Cookie header string to be sent with `request`, or None."""
    return requests.cookies.get_cookie_header(jar=jar, request=request)


@mcp.tool(name="merge_cookies")
def merge_cookies(cookiejar: Any, cookies: Any):
    """Add cookies to cookiejar and returns a merged CookieJar."""
    return requests.cookies.merge_cookies(cookiejar=cookiejar, cookies=cookies)


@mcp.tool(name="morsel_to_cookie")
def morsel_to_cookie(morsel: Any):
    """Convert a Morsel object into a Cookie containing the one k/v pair."""
    return requests.cookies.morsel_to_cookie(morsel=morsel)


@mcp.tool(name="remove_cookie_by_name")
def remove_cookie_by_name(cookiejar: Any, name: Any, domain: Any = None, path: Any = None):
    """Unsets a cookie by name, by default over all domains and paths."""
    return requests.cookies.remove_cookie_by_name(cookiejar=cookiejar, name=name, domain=domain, path=path)


@mcp.tool(name="add_header")
def add_header(key: Any, val: Any):
    """cookiejar has no legitimate use for this method; add it back if you find one."""
    return requests.cookies.MockRequest.add_header(key=key, val=val)


@mcp.tool(name="add_unredirected_header")
def add_unredirected_header(name: Any, value: Any):
    """Executes the add_unredirected_header operation."""
    return requests.cookies.MockRequest.add_unredirected_header(name=name, value=value)


@mcp.tool(name="get_full_url")
def get_full_url():
    """Executes the get_full_url operation."""
    return requests.cookies.MockRequest.get_full_url()


@mcp.tool(name="get_header")
def get_header(name: Any, default: Any = None):
    """Executes the get_header operation."""
    return requests.cookies.MockRequest.get_header(name=name, default=default)


@mcp.tool(name="get_host")
def get_host():
    """Executes the get_host operation."""
    return requests.cookies.MockRequest.get_host()


@mcp.tool(name="get_new_headers")
def get_new_headers():
    """Executes the get_new_headers operation."""
    return requests.cookies.MockRequest.get_new_headers()


@mcp.tool(name="get_origin_req_host")
def get_origin_req_host():
    """Executes the get_origin_req_host operation."""
    return requests.cookies.MockRequest.get_origin_req_host()


@mcp.tool(name="get_type")
def get_type():
    """Executes the get_type operation."""
    return requests.cookies.MockRequest.get_type()


@mcp.tool(name="has_header")
def has_header(name: Any):
    """Executes the has_header operation."""
    return requests.cookies.MockRequest.has_header(name=name)


@mcp.tool(name="is_unverifiable")
def is_unverifiable():
    """Executes the is_unverifiable operation."""
    return requests.cookies.MockRequest.is_unverifiable()


@mcp.tool(name="getheaders")
def getheaders(name: Any):
    """Executes the getheaders operation."""
    return requests.cookies.MockResponse.getheaders(name=name)


@mcp.tool(name="info")
def info():
    """Executes the info operation."""
    return requests.cookies.MockResponse.info()


@mcp.tool(name="copy")
def copy():
    """Return a copy of this RequestsCookieJar."""
    return requests.cookies.RequestsCookieJar.copy()


@mcp.tool(name="get")
def get(name: Any, default: Any = None, domain: Any = None, path: Any = None):
    """Dict-like get() that also supports optional domain and path args in
order to resolve naming collisions from using one cookie jar over
multiple domains."""
    return requests.cookies.RequestsCookieJar.get(name=name, default=default, domain=domain, path=path)


@mcp.tool(name="get_dict")
def get_dict(domain: Any = None, path: Any = None):
    """Takes as an argument an optional domain and path and returns a plain
old Python dict of name-value pairs of cookies that meet the
requirements."""
    return requests.cookies.RequestsCookieJar.get_dict(domain=domain, path=path)


@mcp.tool(name="get_policy")
def get_policy():
    """Return the CookiePolicy instance used."""
    return requests.cookies.RequestsCookieJar.get_policy()


@mcp.tool(name="items")
def items():
    """Dict-like items() that returns a list of name-value tuples from the
jar."""
    return requests.cookies.RequestsCookieJar.items()


@mcp.tool(name="iteritems")
def iteritems():
    """Dict-like iteritems() that returns an iterator of name-value tuples
from the jar."""
    return requests.cookies.RequestsCookieJar.iteritems()


@mcp.tool(name="iterkeys")
def iterkeys():
    """Dict-like iterkeys() that returns an iterator of names of cookies
from the jar."""
    return requests.cookies.RequestsCookieJar.iterkeys()


@mcp.tool(name="itervalues")
def itervalues():
    """Dict-like itervalues() that returns an iterator of values of cookies
from the jar."""
    return requests.cookies.RequestsCookieJar.itervalues()


@mcp.tool(name="keys")
def keys():
    """Dict-like keys() that returns a list of names of cookies from the
jar."""
    return requests.cookies.RequestsCookieJar.keys()


@mcp.tool(name="list_domains")
def list_domains():
    """Utility method to list all the domains in the jar."""
    return requests.cookies.RequestsCookieJar.list_domains()


@mcp.tool(name="list_paths")
def list_paths():
    """Utility method to list all the paths in the jar."""
    return requests.cookies.RequestsCookieJar.list_paths()


@mcp.tool(name="multiple_domains")
def multiple_domains():
    """Returns True if there are multiple domains in the jar."""
    return requests.cookies.RequestsCookieJar.multiple_domains()


@mcp.tool(name="set")
def set(name: Any, value: Any, **kwargs: Any):
    """Dict-like set() that also supports optional domain and path args in
order to resolve naming collisions from using one cookie jar over
multiple domains."""
    return requests.cookies.RequestsCookieJar.set(name=name, value=value, **kwargs)


@mcp.tool(name="set_cookie")
def set_cookie(cookie: Any, *args: Any, **kwargs: Any):
    """Set a cookie, without checking whether or not it should be set."""
    return requests.cookies.RequestsCookieJar.set_cookie(cookie=cookie, *args, **kwargs)


@mcp.tool(name="update")
def update(other: Any):
    """Updates this jar with cookies from another CookieJar or dict-like."""
    return requests.cookies.RequestsCookieJar.update(other=other)


@mcp.tool(name="values")
def values():
    """Dict-like values() that returns a list of values of cookies from the
jar."""
    return requests.cookies.RequestsCookieJar.values()


@mcp.tool(name="info")
def info():
    """Generate information for a bug report."""
    return requests.help.info()


@mcp.tool(name="main")
def main():
    """Pretty-print the bug information as JSON."""
    return requests.help.main()


@mcp.tool(name="default_hooks")
def default_hooks():
    """Executes the default_hooks operation."""
    return requests.hooks.default_hooks()


@mcp.tool(name="dispatch_hook")
def dispatch_hook(key: Any, hooks: Any, hook_data: Any, **kwargs: Any):
    """Dispatches a hook dictionary on a given piece of data."""
    return requests.hooks.dispatch_hook(key=key, hooks=hooks, hook_data=hook_data, **kwargs)


@mcp.tool(name="copy")
def copy():
    """Executes the copy operation."""
    return requests.models.PreparedRequest.copy()


@mcp.tool(name="prepare")
def prepare(method: Any = None, url: Any = None, headers: Any = None, files: Any = None, data: Any = None, params: Any = None, auth: Any = None, cookies: Any = None, hooks: Any = None, json: Any = None):
    """Prepares the entire request with the given parameters."""
    return requests.models.PreparedRequest.prepare(method=method, url=url, headers=headers, files=files, data=data, params=params, auth=auth, cookies=cookies, hooks=hooks, json=json)


@mcp.tool(name="prepare_auth")
def prepare_auth(auth: Any, url: Any = ''):
    """Prepares the given HTTP auth data."""
    return requests.models.PreparedRequest.prepare_auth(auth=auth, url=url)


@mcp.tool(name="prepare_body")
def prepare_body(data: Any, files: Any, json: Any = None):
    """Prepares the given HTTP body data."""
    return requests.models.PreparedRequest.prepare_body(data=data, files=files, json=json)


@mcp.tool(name="prepare_content_length")
def prepare_content_length(body: Any):
    """Prepare Content-Length header based on request method and body."""
    return requests.models.PreparedRequest.prepare_content_length(body=body)


@mcp.tool(name="prepare_cookies")
def prepare_cookies(cookies: Any):
    """Prepares the given HTTP cookie data."""
    return requests.models.PreparedRequest.prepare_cookies(cookies=cookies)


@mcp.tool(name="prepare_headers")
def prepare_headers(headers: Any):
    """Prepares the given HTTP headers."""
    return requests.models.PreparedRequest.prepare_headers(headers=headers)


@mcp.tool(name="prepare_hooks")
def prepare_hooks(hooks: Any):
    """Prepares the given hooks."""
    return requests.models.PreparedRequest.prepare_hooks(hooks=hooks)


@mcp.tool(name="prepare_method")
def prepare_method(method: Any):
    """Prepares the given HTTP method."""
    return requests.models.PreparedRequest.prepare_method(method=method)


@mcp.tool(name="prepare_url")
def prepare_url(url: Any, params: Any):
    """Prepares the given HTTP URL."""
    return requests.models.PreparedRequest.prepare_url(url=url, params=params)


@mcp.tool(name="prepare")
def prepare():
    """Constructs a :class:`PreparedRequest <PreparedRequest>` for transmission and returns it."""
    return requests.models.Request.prepare()


@mcp.tool(name="deregister_hook")
def deregister_hook(event: Any, hook: Any):
    """Deregister a previously registered hook."""
    return requests.models.RequestHooksMixin.deregister_hook(event=event, hook=hook)


@mcp.tool(name="register_hook")
def register_hook(event: Any, hook: Any):
    """Properly register a hook."""
    return requests.models.RequestHooksMixin.register_hook(event=event, hook=hook)


@mcp.tool(name="close")
def close():
    """Releases the connection back to the pool."""
    return requests.models.Response.close()


@mcp.tool(name="iter_content")
def iter_content(chunk_size: Any = 1, decode_unicode: Any = False):
    """Iterates over the response data."""
    return requests.models.Response.iter_content(chunk_size=chunk_size, decode_unicode=decode_unicode)


@mcp.tool(name="iter_lines")
def iter_lines(chunk_size: Any = 512, decode_unicode: Any = False, delimiter: Any = None):
    """Iterates over the response data, one line at a time."""
    return requests.models.Response.iter_lines(chunk_size=chunk_size, decode_unicode=decode_unicode, delimiter=delimiter)


@mcp.tool(name="json")
def json(**kwargs: Any):
    """Decodes the JSON response body (if any) as a Python object."""
    return requests.models.Response.json(**kwargs)


@mcp.tool(name="raise_for_status")
def raise_for_status():
    """Raises :class:`HTTPError`, if one occurred."""
    return requests.models.Response.raise_for_status()


@mcp.tool(name="merge_hooks")
def merge_hooks(request_hooks: Any, session_hooks: Any, dict_class: Any = None):
    """Properly merges both requests and session hooks."""
    return requests.sessions.merge_hooks(request_hooks=request_hooks, session_hooks=session_hooks, dict_class=dict_class)


@mcp.tool(name="merge_setting")
def merge_setting(request_setting: Any, session_setting: Any, dict_class: Any = None):
    """Determines appropriate setting for a given request, taking into account
the explicit setting on that request, and the setting in the session."""
    return requests.sessions.merge_setting(request_setting=request_setting, session_setting=session_setting, dict_class=dict_class)


@mcp.tool(name="session")
def session():
    """Returns a :class:`Session` for context-management."""
    return requests.sessions.session()


@mcp.tool(name="close")
def close():
    """Closes all adapters and as such the session."""
    return requests.sessions.Session.close()


@mcp.tool(name="delete")
def delete(url: Any, **kwargs: Any):
    """Sends a DELETE request."""
    return requests.sessions.Session.delete(url=url, **kwargs)


@mcp.tool(name="get")
def get(url: Any, **kwargs: Any):
    """Sends a GET request."""
    return requests.sessions.Session.get(url=url, **kwargs)


@mcp.tool(name="get_adapter")
def get_adapter(url: Any):
    """Returns the appropriate connection adapter for the given URL."""
    return requests.sessions.Session.get_adapter(url=url)


@mcp.tool(name="head")
def head(url: Any, **kwargs: Any):
    """Sends a HEAD request."""
    return requests.sessions.Session.head(url=url, **kwargs)


@mcp.tool(name="merge_environment_settings")
def merge_environment_settings(url: Any, proxies: Any, stream: Any, verify: Any, cert: Any):
    """Check the environment and merge it with some settings."""
    return requests.sessions.Session.merge_environment_settings(url=url, proxies=proxies, stream=stream, verify=verify, cert=cert)


@mcp.tool(name="mount")
def mount(prefix: Any, adapter: Any):
    """Registers a connection adapter to a prefix."""
    return requests.sessions.Session.mount(prefix=prefix, adapter=adapter)


@mcp.tool(name="options")
def options(url: Any, **kwargs: Any):
    """Sends a OPTIONS request."""
    return requests.sessions.Session.options(url=url, **kwargs)


@mcp.tool(name="patch")
def patch(url: Any, data: Any = None, **kwargs: Any):
    """Sends a PATCH request."""
    return requests.sessions.Session.patch(url=url, data=data, **kwargs)


@mcp.tool(name="post")
def post(url: Any, data: Any = None, json: Any = None, **kwargs: Any):
    """Sends a POST request."""
    return requests.sessions.Session.post(url=url, data=data, json=json, **kwargs)


@mcp.tool(name="prepare_request")
def prepare_request(request: Any):
    """Constructs a :class:`PreparedRequest <PreparedRequest>` for
transmission and returns it."""
    return requests.sessions.Session.prepare_request(request=request)


@mcp.tool(name="put")
def put(url: Any, data: Any = None, **kwargs: Any):
    """Sends a PUT request."""
    return requests.sessions.Session.put(url=url, data=data, **kwargs)


@mcp.tool(name="request")
def request(method: Any, url: Any, params: Any = None, data: Any = None, headers: Any = None, cookies: Any = None, files: Any = None, auth: Any = None, timeout: Any = None, allow_redirects: Any = True, proxies: Any = None, hooks: Any = None, stream: Any = None, verify: Any = None, cert: Any = None, json: Any = None):
    """Constructs a :class:`Request <Request>`, prepares it and sends it."""
    return requests.sessions.Session.request(method=method, url=url, params=params, data=data, headers=headers, cookies=cookies, files=files, auth=auth, timeout=timeout, allow_redirects=allow_redirects, proxies=proxies, hooks=hooks, stream=stream, verify=verify, cert=cert, json=json)


@mcp.tool(name="send")
def send(request: Any, **kwargs: Any):
    """Send a given PreparedRequest."""
    return requests.sessions.Session.send(request=request, **kwargs)


@mcp.tool(name="get_redirect_target")
def get_redirect_target(resp: Any):
    """Receives a Response."""
    return requests.sessions.SessionRedirectMixin.get_redirect_target(resp=resp)


@mcp.tool(name="rebuild_auth")
def rebuild_auth(prepared_request: Any, response: Any):
    """When being redirected we may want to strip authentication from the
request to avoid leaking credentials."""
    return requests.sessions.SessionRedirectMixin.rebuild_auth(prepared_request=prepared_request, response=response)


@mcp.tool(name="rebuild_method")
def rebuild_method(prepared_request: Any, response: Any):
    """When being redirected we may want to change the method of the request
based on certain specs or browser behavior."""
    return requests.sessions.SessionRedirectMixin.rebuild_method(prepared_request=prepared_request, response=response)


@mcp.tool(name="rebuild_proxies")
def rebuild_proxies(prepared_request: Any, proxies: Any):
    """This method re-evaluates the proxy configuration by considering the
environment variables."""
    return requests.sessions.SessionRedirectMixin.rebuild_proxies(prepared_request=prepared_request, proxies=proxies)


@mcp.tool(name="resolve_redirects")
def resolve_redirects(resp: Any, req: Any, stream: Any = False, timeout: Any = None, verify: Any = True, cert: Any = None, proxies: Any = None, yield_requests: Any = False, **kwargs: Any):
    """Receives a Response."""
    return requests.sessions.SessionRedirectMixin.resolve_redirects(resp=resp, req=req, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, yield_requests=yield_requests, **kwargs)


@mcp.tool(name="should_strip_auth")
def should_strip_auth(old_url: Any, new_url: Any):
    """Decide whether Authorization header should be removed when redirecting."""
    return requests.sessions.SessionRedirectMixin.should_strip_auth(old_url=old_url, new_url=new_url)


@mcp.tool(name="copy")
def copy():
    """Executes the copy operation."""
    return requests.structures.CaseInsensitiveDict.copy()


@mcp.tool(name="lower_items")
def lower_items():
    """Like iteritems(), but with all lowercase keys."""
    return requests.structures.CaseInsensitiveDict.lower_items()


@mcp.tool(name="get")
def get(key: Any, default: Any = None):
    """Return the value for key if key is in the dictionary, else default."""
    return requests.structures.LookupDict.get(key=key, default=default)


@mcp.tool(name="add_dict_to_cookiejar")
def add_dict_to_cookiejar(cj: Any, cookie_dict: Any):
    """Returns a CookieJar from a key/value dictionary."""
    return requests.utils.add_dict_to_cookiejar(cj=cj, cookie_dict=cookie_dict)


@mcp.tool(name="address_in_network")
def address_in_network(ip: Any, net: Any):
    """This function allows you to check if an IP belongs to a network subnet

Example: returns True if ip = 192."""
    return requests.utils.address_in_network(ip=ip, net=net)


@mcp.tool(name="atomic_open")
def atomic_open(filename: Any):
    """Write a file to the disk in an atomic fashion."""
    return requests.utils.atomic_open(filename=filename)


@mcp.tool(name="check_header_validity")
def check_header_validity(header: Any):
    """Verifies that header parts don't contain leading whitespace
reserved characters, or return characters."""
    return requests.utils.check_header_validity(header=header)


@mcp.tool(name="default_headers")
def default_headers():
    """:rtype: requests."""
    return requests.utils.default_headers()


@mcp.tool(name="default_user_agent")
def default_user_agent(name: Any = 'python-requests'):
    """Return a string representing the default user agent."""
    return requests.utils.default_user_agent(name=name)


@mcp.tool(name="dict_from_cookiejar")
def dict_from_cookiejar(cj: Any):
    """Returns a key/value dictionary from a CookieJar."""
    return requests.utils.dict_from_cookiejar(cj=cj)


@mcp.tool(name="dict_to_sequence")
def dict_to_sequence(d: Any):
    """Returns an internal sequence dictionary update."""
    return requests.utils.dict_to_sequence(d=d)


@mcp.tool(name="dotted_netmask")
def dotted_netmask(mask: Any):
    """Converts mask from /xx format to xxx."""
    return requests.utils.dotted_netmask(mask=mask)


@mcp.tool(name="extract_zipped_paths")
def extract_zipped_paths(path: Any):
    """Replace nonexistent paths that look like they refer to a member of a zip
archive with the location of an extracted copy of the target, or else
just return the provided path unchanged."""
    return requests.utils.extract_zipped_paths(path=path)


@mcp.tool(name="from_key_val_list")
def from_key_val_list(value: Any):
    """Take an object and test to see if it can be represented as a
dictionary."""
    return requests.utils.from_key_val_list(value=value)


@mcp.tool(name="get_auth_from_url")
def get_auth_from_url(url: Any):
    """Given a url with authentication components, extract them into a tuple of
username,password."""
    return requests.utils.get_auth_from_url(url=url)


@mcp.tool(name="get_encoding_from_headers")
def get_encoding_from_headers(headers: Any):
    """Returns encodings from given HTTP Header Dict."""
    return requests.utils.get_encoding_from_headers(headers=headers)


@mcp.tool(name="get_encodings_from_content")
def get_encodings_from_content(content: Any):
    """Returns encodings from given content string."""
    return requests.utils.get_encodings_from_content(content=content)


@mcp.tool(name="get_environ_proxies")
def get_environ_proxies(url: Any, no_proxy: Any = None):
    """Return a dict of environment proxies."""
    return requests.utils.get_environ_proxies(url=url, no_proxy=no_proxy)


@mcp.tool(name="get_netrc_auth")
def get_netrc_auth(url: Any, raise_errors: Any = False):
    """Returns the Requests tuple auth for a given url from netrc."""
    return requests.utils.get_netrc_auth(url=url, raise_errors=raise_errors)


@mcp.tool(name="get_unicode_from_response")
def get_unicode_from_response(r: Any):
    """Returns the requested content back in unicode."""
    return requests.utils.get_unicode_from_response(r=r)


@mcp.tool(name="guess_filename")
def guess_filename(obj: Any):
    """Tries to guess the filename of the given object."""
    return requests.utils.guess_filename(obj=obj)


@mcp.tool(name="guess_json_utf")
def guess_json_utf(data: Any):
    """:rtype: str."""
    return requests.utils.guess_json_utf(data=data)


@mcp.tool(name="is_ipv4_address")
def is_ipv4_address(string_ip: Any):
    """:rtype: bool."""
    return requests.utils.is_ipv4_address(string_ip=string_ip)


@mcp.tool(name="is_valid_cidr")
def is_valid_cidr(string_network: Any):
    """Very simple check of the cidr format in no_proxy variable."""
    return requests.utils.is_valid_cidr(string_network=string_network)


@mcp.tool(name="iter_slices")
def iter_slices(string: Any, slice_length: Any):
    """Iterate over slices of a string."""
    return requests.utils.iter_slices(string=string, slice_length=slice_length)


@mcp.tool(name="parse_dict_header")
def parse_dict_header(value: Any):
    """Parse lists of key, value pairs as described by RFC 2068 Section 2 and
convert them into a python dict:

>>> d = parse_dict_header('foo="is a fish", bar="as well"')
>>> type(d) is dict
True
>>> sorted(d."""
    return requests.utils.parse_dict_header(value=value)


@mcp.tool(name="parse_header_links")
def parse_header_links(value: Any):
    """Return a list of parsed link headers proxies."""
    return requests.utils.parse_header_links(value=value)


@mcp.tool(name="parse_list_header")
def parse_list_header(value: Any):
    """Parse lists as described by RFC 2068 Section 2."""
    return requests.utils.parse_list_header(value=value)


@mcp.tool(name="prepend_scheme_if_needed")
def prepend_scheme_if_needed(url: Any, new_scheme: Any):
    """Given a URL that may or may not have a scheme, prepend the given scheme."""
    return requests.utils.prepend_scheme_if_needed(url=url, new_scheme=new_scheme)


@mcp.tool(name="requote_uri")
def requote_uri(uri: Any):
    """Re-quote the given URI."""
    return requests.utils.requote_uri(uri=uri)


@mcp.tool(name="resolve_proxies")
def resolve_proxies(request: Any, proxies: Any, trust_env: Any = True):
    """This method takes proxy information from a request and configuration
input to resolve a mapping of target proxies."""
    return requests.utils.resolve_proxies(request=request, proxies=proxies, trust_env=trust_env)


@mcp.tool(name="rewind_body")
def rewind_body(prepared_request: Any):
    """Move file pointer back to its recorded starting position
so it can be read again on redirect."""
    return requests.utils.rewind_body(prepared_request=prepared_request)


@mcp.tool(name="select_proxy")
def select_proxy(url: Any, proxies: Any):
    """Select a proxy for the url, if applicable."""
    return requests.utils.select_proxy(url=url, proxies=proxies)


@mcp.tool(name="set_environ")
def set_environ(env_name: Any, value: Any):
    """Set the environment variable 'env_name' to 'value'

Save previous value, yield, and then restore the previous value stored in
the environment variable 'env_name'."""
    return requests.utils.set_environ(env_name=env_name, value=value)


@mcp.tool(name="should_bypass_proxies")
def should_bypass_proxies(url: Any, no_proxy: Any):
    """Returns whether we should bypass proxies or not."""
    return requests.utils.should_bypass_proxies(url=url, no_proxy=no_proxy)


@mcp.tool(name="stream_decode_response_unicode")
def stream_decode_response_unicode(iterator: Any, r: Any):
    """Stream decodes an iterator."""
    return requests.utils.stream_decode_response_unicode(iterator=iterator, r=r)


@mcp.tool(name="super_len")
def super_len(o: Any):
    """Executes the super_len operation."""
    return requests.utils.super_len(o=o)


@mcp.tool(name="to_key_val_list")
def to_key_val_list(value: Any):
    """Take an object and test to see if it can be represented as a
dictionary."""
    return requests.utils.to_key_val_list(value=value)


@mcp.tool(name="unquote_header_value")
def unquote_header_value(value: Any, is_filename: Any = False):
    """Unquotes a header value."""
    return requests.utils.unquote_header_value(value=value, is_filename=is_filename)


@mcp.tool(name="unquote_unreserved")
def unquote_unreserved(uri: Any):
    """Un-escape any percent-escape sequences in a URI that are unreserved
characters."""
    return requests.utils.unquote_unreserved(uri=uri)


@mcp.tool(name="urldefragauth")
def urldefragauth(url: Any):
    """Given a url remove the fragment and the authentication part."""
    return requests.utils.urldefragauth(url=url)




if __name__ == "__main__":
    mcp.run()
