R/aaa.R

Defines functions tool_fun is_new_ellmer

the <- new_environment()
the$server_processes <- list()

# ellmer 0.3.0 --------------------------------------------------------------
# the ellmer 0.3.0 release will make a number of breaking changes.
# we'll include a few functions to future-proof the initial release of mcptools
# for that package release (#52).
is_new_ellmer <- function() {
  packageVersion("ellmer") >= "0.2.1.9000"
}

tool_fun <- function(tool) {
  if (is_new_ellmer()) {
    return(tool)
  }

  tool@fun
}

Try the mcptools package in your browser

Any scripts or data that you put into this service are public.

mcptools documentation built on Sept. 9, 2025, 5:45 p.m.