languagetool-org/languagetool · warning · BadRequestException

Missing arguments for LanguageTool API. Please see

Error message

Missing arguments for LanguageTool API. Please see 

What it means

Thrown by LanguageTool's embedded HTTP server when a client requests the server root path ('/') without any parameters. The server expects API calls at a versioned path like /v2/check; hitting bare '/' means no API endpoint or arguments were given. The message points to the API documentation URL.

Source

Thrown at languagetool-server/src/main/java/org/languagetool/server/LanguageToolHttpHandler.java:217

        sendError(httpExchange, code, errorMessage);
        logError(errorMessage, code, parameters, httpExchange);
        return;
      }
      if (workQueueFull(httpExchange, parameters, "Error: There are currently too many parallel requests. Please try again later.")) {
        ServerMetricsCollector.getInstance().logRequestError(ServerMetricsCollector.RequestErrorType.QUEUE_FULL);
        return;
      }
      if (allowedIps == null || allowedIps.contains(origAddress)) {
        if (path.startsWith("/v2/")) {
          ApiV2 apiV2 = new ApiV2(textCheckerV2, config.getAllowOriginUrl());
          String pathWithoutVersion = path.substring("/v2/".length());
          final Map<String, String> finalParameters = parameters;
          final String finalRemoteAddress = remoteAddress;
          TelemetryProvider.INSTANCE.createSpan("/v2", Attributes.empty(), () -> apiV2.handleRequest(pathWithoutVersion, httpExchange, finalParameters, errorRequestLimiter, finalRemoteAddress, config));
        } else if (path.endsWith("/Languages")) {
          throw new BadRequestException("You're using an old version of our API that's not supported anymore. Please see " + API_DOC_URL);
        } else if (path.equals("/")) {
          throw new BadRequestException("Missing arguments for LanguageTool API. Please see " + API_DOC_URL);
        } else if (path.contains("/v2/")) {
          throw new BadRequestException("You have '/v2/' in your path, but not at the root. Try an URL like 'http://server/v2/...' ");
        } else if (path.equals("/favicon.ico")) {
          sendError(httpExchange, HttpURLConnection.HTTP_NOT_FOUND, "Not found");
        } else {
          throw new BadRequestException("This is the LanguageTool API. You have not specified any parameters. Please see " + API_DOC_URL);
        }
      } else {
        String errorMessage = "Error: Access from " + StringTools.escapeXML(origAddress) + " denied";
        sendError(httpExchange, HttpURLConnection.HTTP_FORBIDDEN, errorMessage);
        throw new RuntimeException(errorMessage);
      }
    } catch (Exception e) {
      String response;
      int errorCode;
      boolean textLoggingAllowed = false;
      boolean logStacktrace = true;
      Throwable rootCause = ExceptionUtils.getRootCause(e);

View on GitHub (pinned to 2e990059ce)

Solutions

  1. Call a real API endpoint such as POST http://server/v2/check with text and language parameters
  2. Check that your client/proxy is not stripping the /v2/check path from the URL
  3. Consult the linked API documentation for the correct endpoint and required parameters

Example fix

// before
curl http://localhost:8081/
// after
curl -X POST http://localhost:8081/v2/check -d 'text=my text&language=en-US'
Defensive patterns

Strategy: validation

Validate before calling

const url = new URL(serverUrl);
if (url.pathname === '/' || !url.pathname.startsWith('/v2/')) {
  throw new Error(`Use /v2/check endpoint, got path '${url.pathname}'`);
}

Prevention

When it happens

Trigger: HTTP GET/POST to the server root URL exactly '/' instead of '/v2/check' or another /v2/ endpoint.

Common situations: Developers curl the server root to test if it is up, misconfigured reverse proxies strip the /v2/check path, or users paste the base server URL into a browser expecting a UI.

Understand the failure class

Background: "Invalid URL" / "URL cannot be empty": fix the malformed or missing URL behind request-construction failures — this error's family across 50 libraries.

Related errors


AI-assisted analysis of languagetool-org/languagetool@2e990059ce (2026-09-06). Data as JSON: /api/errors/1cb53e290775a4e2. Report an issue: GitHub.