Agents

A checker your coding agent can call.

A coding agent stops at whatever compiles. functype puts more into the types, lints what types can't say, and tells the agent what to write instead.

The bug compiles. The check doesn't let it through.

users.save returns an Either, so a failed save is a value, not a throw. Drop it and TypeScript says nothing: the user is welcomed whether or not the save worked.

validate_code runs the compiler and functype's lint preset, and the error tells the agent what to write instead.

agent session
  1. You

    Save the new user, then welcome them.

  2. Agent
    7export const register = (user: User): string => {
    8  users.save(user)
    9  return `Welcome, ${user.email}`
    10}
    tsc: 0 errors
  3. validate_code

    ✗ Line 8: This result is dropped, so a failure in it is silently ignored. Check isLeft() / isFailure(), fold it, or return it.functype/no-floating-result

  4. Agent
    -  register = (user: User): string => { …
    +  register = (user: User): Either<SaveError, string> =>
    +    users.save(user).map((saved) => `Welcome, ${saved.email}`)
  5. validate_code

    ✓ PASSED. The code is type-correct and passes the lint preset.

A compiler checks only what the types say.

Strict TypeScript already catches a value that might be missing. It can't see a thrown error, or what an effect needs before it runs. functype puts those in the types too, so the compiler checks an agent's error handling, not only its spelling.

Either<NotFound, User>

Failures

The error is part of the signature. Dropping the result without handling it is a lint error.

IO<Users, DbError, User>

Effects

What it needs, how it fails, and nothing runs until you run it. Run it without its services and the compiler says: "Provide these services first, with provideLayer or provideService".

Option<User>

Missing values

Like strict null checks, but chainable: an agent can't read .name off a user that might not be there. It handles None or the code doesn't compile.

The escape hatches are guarded too. Rust has unsafe. TypeScript has null, throw and .orThrow(), and functype's lint preset reports each one unless the code marks it as a real boundary.

Set it up

Claude Code

The plugin installs functype's skills and the MCP server together.

/plugin marketplace add jordanburke/functype
/plugin install functype

Any MCP client

Cursor, Windsurf and other clients that read an mcpServers config: add the server there.

{
  "mcpServers": {
    "functype": {
      "command": "npx",
      "args": ["-y", "functype-mcp-server"]
    }
  }
}

Your build

The preset the MCP server runs, in your build, so CI holds the agent to it too. Its type-aware rules need parserOptions.projectService.

npm i -D eslint-plugin-functype
import functype from "eslint-plugin-functype"

export default [
  functype.configs.recommended,
  functype.configs.tests,
]

Any model

The whole library as text, for a model that can fetch a URL but runs no tools.

https://functype.org/llms.txt       # an index
https://functype.org/llms-full.txt  # everything

What the MCP server gives an agent

search_docs

Every type and its interfaces, or a keyword search.

get_type_api

One type's full API: constructors, methods and what each returns.

get_interfaces

The interface hierarchy: Functor, Monad, Foldable and the rest.

validate_code

Type-checks a snippet, then lints it with the recommended preset.

set_functype_version

Switches the docs and the checker to the version your project uses.

Details and example output: the MCP server page.

A lint preset built for agents

Every rule is an error or off. An agent fixes what fails its build and passes over a warning, so a rule that isn't reliable stays off until it is.

A rule turns on once it's right on real code: about 95–99% of the time, with its known kinds of false alarm closed rather than left to warn.

Every message names the fix. "Call it: head()" is an instruction an agent can follow in one edit.

  • functype/no-floating-io0 false positives across about 1,340 IO-typed calls in five codebases.
  • functype/no-array-mutation91 hits across five consumers, every one a real in-place mutation.
  • functype/no-uncalled-method0 hits on 1,126 files of seven codebases. On supabase-typed-query's code from before its 2.0 port, it reports the Option(list.head) that port fixed.
  • functype/no-serialize-container4 hits on one API, each a bug that project then fixed by hand.
  • functype/no-container-mutation0 hits on 1,128 files of seven codebases, 343 of them tests, and every write planted through a cast is reported.

Every rule, with its options and measurements: the ESLint page.