LangChain Reference home page
Search...
⌘K
Ask AI
GitHub
Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
⌘I
LangChain Assistant
New
History
Ask a question to get started
Enter
to send
•
Shift+Enter
new line
Menu
Navigation
Projects
Anthropic
AWS
Cloudflare
DeepSeek
Google
Node
Google Common
Google GAuth
Google GenAI
Google Vertex AI
Google Vertex AI Web
Google WebAuth
Groq
Mistral AI
MongoDB
Ollama
OpenAI
OpenRouter
Redis
xAI
Language
Python
JavaScript
Theme
Light
Dark
JavaScript
@langchain/community
tools
calculator
Calculator
Class
latest
●
Since v1.0
Calculator
Copy
class
Calculator
Bases
Tool
Used in Docs
Web browser integration
Constructors
Properties
Methods
Inherited from
Tool
(langchain_core)
Attributes
A
func
A
coroutine
A
args
Methods
M
ainvoke
M
View source on GitHub
Version History
from_function
Inherited from
BaseTool
(langchain_core)
Attributes
A
args_schema
A
return_direct
A
handle_tool_error
A
handle_validation_error
A
response_format
A
model_config
A
is_single_input
A
args
A
tool_call_schema
Methods
M
model_copy
M
get_input_schema
M
ainvoke
M
run
M
arun
Inherited from
RunnableSerializable
(langchain_core)
Attributes
A
model_config
Methods
M
to_json
M
configurable_fields
M
configurable_alternatives
Inherited from
Serializable
Properties
P
lc_kwargs
P
lc_namespace
P
lc_serializable
P
lc_aliases
P
lc_attributes
P
lc_id
P
lc_secrets
P
lc_serializable_keys
Methods
M
toJSON
M
toJSONNotImplemented
M
lc_name
Inherited from
Runnable
(langchain_core)
Attributes
A
InputType
A
OutputType
A
input_schema
A
output_schema
A
config_specs
Methods
M
get_name
M
get_input_schema
M
get_input_jsonschema
M
get_output_schema
M
get_output_jsonschema
M
config_schema
constructor
constructor
property
callbacks
:
Callbacks
property
defaultConfig
:
ToolRunnableConfig
property
description
:
string
property
extras
:
Record
<
string
,
unknown
>
property
lc_kwargs
:
SerializedFields
property
lc_runnable
:
boolean
property
lc_serializable
:
boolean
property
metadata
:
Record
<
string
,
unknown
>
property
name
:
string
property
responseFormat
:
string
property
returnDirect
:
boolean
property
schema
:
ZodEffects
<
ZodObject
<__
type
,
"strip"
,
ZodTypeAny
, __
type
, __
type
>,
string
|
undefined
, __
type
>
property
tags
:
string
[]
property
verbose
:
boolean
property
verboseParsingErrors
:
boolean
property
lc_aliases
property
lc_attributes
property
lc_id
property
lc_namespace
property
lc_secrets
property
lc_serializable_keys
method
_addVersion
method
_batchWithConfig
method
_callWithConfig
method
_getOptionsList
method
_separateRunnableConfigFromCallOptions
method
_streamIterator
method
_streamLog
method
_transformStreamWithConfig
method
assign
method
asTool
method
batch
method
call
method
getGraph
method
getName
method
invoke
method
pick
method
pipe
method
stream
method
streamEvents
method
streamLog
method
toJSON
method
toJSONNotImplemented
method
transform
method
withConfig
method
withFallbacks
method
withListeners
method
withRetry
method
isRunnable
method
lc_name
M
get_config_jsonschema
M
get_graph
M
get_prompts
M
ainvoke
M
batch_as_completed
M
abatch
M
abatch_as_completed
M
astream
M
astream_log
M
astream_events
M
stream_events
M
atransform
M
bind
M
with_config
M
with_listeners
M
with_alisteners
M
with_types
M
with_retry
M
map
M
with_fallbacks
M
as_tool