Skip to main content
Glama

proxy_set_host_upstream

Configure per-host proxy overrides to route traffic for specific hostnames through designated upstream proxies instead of the global proxy.

Instructions

Set a per-host upstream proxy override. Traffic to this hostname will use the specified proxy instead of the global one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostnameYesHostname to override (e.g., api.example.com)
proxy_urlYesUpstream proxy URL for this host
no_proxyNoHostnames to bypass this proxy

Implementation Reference

  • Implementation of the proxy_set_host_upstream tool handler.
    server.tool(
      "proxy_set_host_upstream",
      "Set a per-host upstream proxy override. Traffic to this hostname will use the specified proxy instead of the global one.",
      {
        hostname: z.string().describe("Hostname to override (e.g., api.example.com)"),
        proxy_url: z.string().describe("Upstream proxy URL for this host"),
        no_proxy: z.array(z.string()).optional().describe("Hostnames to bypass this proxy"),
      },
      async ({ hostname, proxy_url, no_proxy }) => {
        try {
          await proxyManager.setHostUpstream(hostname, { proxyUrl: proxy_url, noProxy: no_proxy });
          return {
            content: [{
              type: "text",
              text: JSON.stringify({
                status: "success",
                message: `Upstream for '${hostname}' set to ${proxy_url}`,
              }),
            }],
          };
        } catch (e) {
          return { content: [{ type: "text", text: JSON.stringify({ status: "error", error: String(e) }) }] };
        }
      },
    );

Tool Definition Quality

Score is being calculated. Check back soon.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yfe404/proxy-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server