ai 4.1.54 → 4.1.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -8,6 +8,8 @@ import { ServerResponse } from 'node:http';
8
8
  import { AttributeValue, Tracer } from '@opentelemetry/api';
9
9
  import { z } from 'zod';
10
10
  import { ServerResponse as ServerResponse$1 } from 'http';
11
+ import { IOType } from 'node:child_process';
12
+ import { Stream } from 'node:stream';
11
13
 
12
14
  /**
13
15
  Language model that is used by the AI SDK Core functions.
@@ -1587,8 +1589,8 @@ type ReasoningDetail = {
1587
1589
  data: string;
1588
1590
  };
1589
1591
 
1590
- type Parameters = z.ZodTypeAny | Schema<any>;
1591
- type inferParameters<PARAMETERS extends Parameters> = PARAMETERS extends Schema<any> ? PARAMETERS['_type'] : PARAMETERS extends z.ZodTypeAny ? z.infer<PARAMETERS> : never;
1592
+ type ToolParameters = z.ZodTypeAny | Schema<any>;
1593
+ type inferParameters<PARAMETERS extends ToolParameters> = PARAMETERS extends Schema<any> ? PARAMETERS['_type'] : PARAMETERS extends z.ZodTypeAny ? z.infer<PARAMETERS> : never;
1592
1594
  interface ToolExecutionOptions {
1593
1595
  /**
1594
1596
  * The ID of the tool call. You can use it e.g. when sending tool-call related information with stream data.
@@ -1610,7 +1612,7 @@ This enables the language model to generate the input.
1610
1612
 
1611
1613
  The tool can also contain an optional execute function for the actual execution function of the tool.
1612
1614
  */
1613
- type Tool<PARAMETERS extends Parameters = any, RESULT = any> = {
1615
+ type Tool<PARAMETERS extends ToolParameters = any, RESULT = any> = {
1614
1616
  /**
1615
1617
  The schema of the input that the tool expects. The language model will use this to generate the input.
1616
1618
  It is also used to validate the output of the language model.
@@ -1657,16 +1659,16 @@ The arguments for configuring the tool. Must match the expected arguments define
1657
1659
  /**
1658
1660
  * @deprecated Use `Tool` instead.
1659
1661
  */
1660
- type CoreTool<PARAMETERS extends Parameters = any, RESULT = any> = Tool<PARAMETERS, RESULT>;
1662
+ type CoreTool<PARAMETERS extends ToolParameters = any, RESULT = any> = Tool<PARAMETERS, RESULT>;
1661
1663
  /**
1662
1664
  Helper function for inferring the execute args of a tool.
1663
1665
  */
1664
- declare function tool<PARAMETERS extends Parameters, RESULT>(tool: Tool<PARAMETERS, RESULT> & {
1666
+ declare function tool<PARAMETERS extends ToolParameters, RESULT>(tool: Tool<PARAMETERS, RESULT> & {
1665
1667
  execute: (args: inferParameters<PARAMETERS>, options: ToolExecutionOptions) => PromiseLike<RESULT>;
1666
1668
  }): Tool<PARAMETERS, RESULT> & {
1667
1669
  execute: (args: inferParameters<PARAMETERS>, options: ToolExecutionOptions) => PromiseLike<RESULT>;
1668
1670
  };
1669
- declare function tool<PARAMETERS extends Parameters, RESULT>(tool: Tool<PARAMETERS, RESULT> & {
1671
+ declare function tool<PARAMETERS extends ToolParameters, RESULT>(tool: Tool<PARAMETERS, RESULT> & {
1670
1672
  execute?: undefined;
1671
1673
  }): Tool<PARAMETERS, RESULT> & {
1672
1674
  execute: undefined;
@@ -1714,6 +1716,796 @@ onlyBar('bar');
1714
1716
  */
1715
1717
  type ValueOf<ObjectType, ValueType extends keyof ObjectType = keyof ObjectType> = ObjectType[ValueType];
1716
1718
 
1719
+ type ToolSchemas = Record<string, {
1720
+ parameters: ToolParameters;
1721
+ }> | 'automatic' | undefined;
1722
+ type McpToolSet<TOOL_SCHEMAS extends ToolSchemas = 'automatic'> = TOOL_SCHEMAS extends Record<string, {
1723
+ parameters: ToolParameters;
1724
+ }> ? {
1725
+ [K in keyof TOOL_SCHEMAS]: Tool<TOOL_SCHEMAS[K]['parameters'], CallToolResult> & {
1726
+ execute: (args: inferParameters<TOOL_SCHEMAS[K]['parameters']>, options: ToolExecutionOptions) => PromiseLike<CallToolResult>;
1727
+ };
1728
+ } : {
1729
+ [k: string]: Tool<z.ZodUnknown, CallToolResult> & {
1730
+ execute: (args: unknown, options: ToolExecutionOptions) => PromiseLike<CallToolResult>;
1731
+ };
1732
+ };
1733
+ interface McpStdioServerConfig {
1734
+ command: string;
1735
+ args?: string[];
1736
+ env?: Record<string, string>;
1737
+ stderr?: IOType | Stream | number;
1738
+ cwd?: string;
1739
+ type: 'stdio';
1740
+ }
1741
+ interface McpSSEServerConfig {
1742
+ type: 'sse';
1743
+ url: string;
1744
+ }
1745
+ type TransportConfig = McpStdioServerConfig | McpSSEServerConfig;
1746
+ declare const CallToolResultSchema: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
1747
+ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
1748
+ }, {
1749
+ content: z.ZodArray<z.ZodUnion<[z.ZodObject<{
1750
+ type: z.ZodLiteral<"text">;
1751
+ text: z.ZodString;
1752
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1753
+ type: z.ZodLiteral<"text">;
1754
+ text: z.ZodString;
1755
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1756
+ type: z.ZodLiteral<"text">;
1757
+ text: z.ZodString;
1758
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
1759
+ type: z.ZodLiteral<"image">;
1760
+ data: z.ZodString;
1761
+ mimeType: z.ZodString;
1762
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1763
+ type: z.ZodLiteral<"image">;
1764
+ data: z.ZodString;
1765
+ mimeType: z.ZodString;
1766
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1767
+ type: z.ZodLiteral<"image">;
1768
+ data: z.ZodString;
1769
+ mimeType: z.ZodString;
1770
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
1771
+ type: z.ZodLiteral<"resource">;
1772
+ resource: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
1773
+ /**
1774
+ * The URI of this resource.
1775
+ */
1776
+ uri: z.ZodString;
1777
+ /**
1778
+ * The MIME type of this resource, if known.
1779
+ */
1780
+ mimeType: z.ZodOptional<z.ZodString>;
1781
+ }, {
1782
+ text: z.ZodString;
1783
+ }>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
1784
+ /**
1785
+ * The URI of this resource.
1786
+ */
1787
+ uri: z.ZodString;
1788
+ /**
1789
+ * The MIME type of this resource, if known.
1790
+ */
1791
+ mimeType: z.ZodOptional<z.ZodString>;
1792
+ }, {
1793
+ text: z.ZodString;
1794
+ }>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
1795
+ /**
1796
+ * The URI of this resource.
1797
+ */
1798
+ uri: z.ZodString;
1799
+ /**
1800
+ * The MIME type of this resource, if known.
1801
+ */
1802
+ mimeType: z.ZodOptional<z.ZodString>;
1803
+ }, {
1804
+ text: z.ZodString;
1805
+ }>, z.ZodTypeAny, "passthrough">>, z.ZodObject<z.objectUtil.extendShape<{
1806
+ /**
1807
+ * The URI of this resource.
1808
+ */
1809
+ uri: z.ZodString;
1810
+ /**
1811
+ * The MIME type of this resource, if known.
1812
+ */
1813
+ mimeType: z.ZodOptional<z.ZodString>;
1814
+ }, {
1815
+ blob: z.ZodString;
1816
+ }>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
1817
+ /**
1818
+ * The URI of this resource.
1819
+ */
1820
+ uri: z.ZodString;
1821
+ /**
1822
+ * The MIME type of this resource, if known.
1823
+ */
1824
+ mimeType: z.ZodOptional<z.ZodString>;
1825
+ }, {
1826
+ blob: z.ZodString;
1827
+ }>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
1828
+ /**
1829
+ * The URI of this resource.
1830
+ */
1831
+ uri: z.ZodString;
1832
+ /**
1833
+ * The MIME type of this resource, if known.
1834
+ */
1835
+ mimeType: z.ZodOptional<z.ZodString>;
1836
+ }, {
1837
+ blob: z.ZodString;
1838
+ }>, z.ZodTypeAny, "passthrough">>]>;
1839
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1840
+ type: z.ZodLiteral<"resource">;
1841
+ resource: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
1842
+ /**
1843
+ * The URI of this resource.
1844
+ */
1845
+ uri: z.ZodString;
1846
+ /**
1847
+ * The MIME type of this resource, if known.
1848
+ */
1849
+ mimeType: z.ZodOptional<z.ZodString>;
1850
+ }, {
1851
+ text: z.ZodString;
1852
+ }>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
1853
+ /**
1854
+ * The URI of this resource.
1855
+ */
1856
+ uri: z.ZodString;
1857
+ /**
1858
+ * The MIME type of this resource, if known.
1859
+ */
1860
+ mimeType: z.ZodOptional<z.ZodString>;
1861
+ }, {
1862
+ text: z.ZodString;
1863
+ }>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
1864
+ /**
1865
+ * The URI of this resource.
1866
+ */
1867
+ uri: z.ZodString;
1868
+ /**
1869
+ * The MIME type of this resource, if known.
1870
+ */
1871
+ mimeType: z.ZodOptional<z.ZodString>;
1872
+ }, {
1873
+ text: z.ZodString;
1874
+ }>, z.ZodTypeAny, "passthrough">>, z.ZodObject<z.objectUtil.extendShape<{
1875
+ /**
1876
+ * The URI of this resource.
1877
+ */
1878
+ uri: z.ZodString;
1879
+ /**
1880
+ * The MIME type of this resource, if known.
1881
+ */
1882
+ mimeType: z.ZodOptional<z.ZodString>;
1883
+ }, {
1884
+ blob: z.ZodString;
1885
+ }>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
1886
+ /**
1887
+ * The URI of this resource.
1888
+ */
1889
+ uri: z.ZodString;
1890
+ /**
1891
+ * The MIME type of this resource, if known.
1892
+ */
1893
+ mimeType: z.ZodOptional<z.ZodString>;
1894
+ }, {
1895
+ blob: z.ZodString;
1896
+ }>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
1897
+ /**
1898
+ * The URI of this resource.
1899
+ */
1900
+ uri: z.ZodString;
1901
+ /**
1902
+ * The MIME type of this resource, if known.
1903
+ */
1904
+ mimeType: z.ZodOptional<z.ZodString>;
1905
+ }, {
1906
+ blob: z.ZodString;
1907
+ }>, z.ZodTypeAny, "passthrough">>]>;
1908
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1909
+ type: z.ZodLiteral<"resource">;
1910
+ resource: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
1911
+ /**
1912
+ * The URI of this resource.
1913
+ */
1914
+ uri: z.ZodString;
1915
+ /**
1916
+ * The MIME type of this resource, if known.
1917
+ */
1918
+ mimeType: z.ZodOptional<z.ZodString>;
1919
+ }, {
1920
+ text: z.ZodString;
1921
+ }>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
1922
+ /**
1923
+ * The URI of this resource.
1924
+ */
1925
+ uri: z.ZodString;
1926
+ /**
1927
+ * The MIME type of this resource, if known.
1928
+ */
1929
+ mimeType: z.ZodOptional<z.ZodString>;
1930
+ }, {
1931
+ text: z.ZodString;
1932
+ }>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
1933
+ /**
1934
+ * The URI of this resource.
1935
+ */
1936
+ uri: z.ZodString;
1937
+ /**
1938
+ * The MIME type of this resource, if known.
1939
+ */
1940
+ mimeType: z.ZodOptional<z.ZodString>;
1941
+ }, {
1942
+ text: z.ZodString;
1943
+ }>, z.ZodTypeAny, "passthrough">>, z.ZodObject<z.objectUtil.extendShape<{
1944
+ /**
1945
+ * The URI of this resource.
1946
+ */
1947
+ uri: z.ZodString;
1948
+ /**
1949
+ * The MIME type of this resource, if known.
1950
+ */
1951
+ mimeType: z.ZodOptional<z.ZodString>;
1952
+ }, {
1953
+ blob: z.ZodString;
1954
+ }>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
1955
+ /**
1956
+ * The URI of this resource.
1957
+ */
1958
+ uri: z.ZodString;
1959
+ /**
1960
+ * The MIME type of this resource, if known.
1961
+ */
1962
+ mimeType: z.ZodOptional<z.ZodString>;
1963
+ }, {
1964
+ blob: z.ZodString;
1965
+ }>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
1966
+ /**
1967
+ * The URI of this resource.
1968
+ */
1969
+ uri: z.ZodString;
1970
+ /**
1971
+ * The MIME type of this resource, if known.
1972
+ */
1973
+ mimeType: z.ZodOptional<z.ZodString>;
1974
+ }, {
1975
+ blob: z.ZodString;
1976
+ }>, z.ZodTypeAny, "passthrough">>]>;
1977
+ }, z.ZodTypeAny, "passthrough">>]>, "many">;
1978
+ isError: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1979
+ }>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
1980
+ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
1981
+ }, {
1982
+ content: z.ZodArray<z.ZodUnion<[z.ZodObject<{
1983
+ type: z.ZodLiteral<"text">;
1984
+ text: z.ZodString;
1985
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1986
+ type: z.ZodLiteral<"text">;
1987
+ text: z.ZodString;
1988
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1989
+ type: z.ZodLiteral<"text">;
1990
+ text: z.ZodString;
1991
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
1992
+ type: z.ZodLiteral<"image">;
1993
+ data: z.ZodString;
1994
+ mimeType: z.ZodString;
1995
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1996
+ type: z.ZodLiteral<"image">;
1997
+ data: z.ZodString;
1998
+ mimeType: z.ZodString;
1999
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2000
+ type: z.ZodLiteral<"image">;
2001
+ data: z.ZodString;
2002
+ mimeType: z.ZodString;
2003
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
2004
+ type: z.ZodLiteral<"resource">;
2005
+ resource: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
2006
+ /**
2007
+ * The URI of this resource.
2008
+ */
2009
+ uri: z.ZodString;
2010
+ /**
2011
+ * The MIME type of this resource, if known.
2012
+ */
2013
+ mimeType: z.ZodOptional<z.ZodString>;
2014
+ }, {
2015
+ text: z.ZodString;
2016
+ }>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
2017
+ /**
2018
+ * The URI of this resource.
2019
+ */
2020
+ uri: z.ZodString;
2021
+ /**
2022
+ * The MIME type of this resource, if known.
2023
+ */
2024
+ mimeType: z.ZodOptional<z.ZodString>;
2025
+ }, {
2026
+ text: z.ZodString;
2027
+ }>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
2028
+ /**
2029
+ * The URI of this resource.
2030
+ */
2031
+ uri: z.ZodString;
2032
+ /**
2033
+ * The MIME type of this resource, if known.
2034
+ */
2035
+ mimeType: z.ZodOptional<z.ZodString>;
2036
+ }, {
2037
+ text: z.ZodString;
2038
+ }>, z.ZodTypeAny, "passthrough">>, z.ZodObject<z.objectUtil.extendShape<{
2039
+ /**
2040
+ * The URI of this resource.
2041
+ */
2042
+ uri: z.ZodString;
2043
+ /**
2044
+ * The MIME type of this resource, if known.
2045
+ */
2046
+ mimeType: z.ZodOptional<z.ZodString>;
2047
+ }, {
2048
+ blob: z.ZodString;
2049
+ }>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
2050
+ /**
2051
+ * The URI of this resource.
2052
+ */
2053
+ uri: z.ZodString;
2054
+ /**
2055
+ * The MIME type of this resource, if known.
2056
+ */
2057
+ mimeType: z.ZodOptional<z.ZodString>;
2058
+ }, {
2059
+ blob: z.ZodString;
2060
+ }>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
2061
+ /**
2062
+ * The URI of this resource.
2063
+ */
2064
+ uri: z.ZodString;
2065
+ /**
2066
+ * The MIME type of this resource, if known.
2067
+ */
2068
+ mimeType: z.ZodOptional<z.ZodString>;
2069
+ }, {
2070
+ blob: z.ZodString;
2071
+ }>, z.ZodTypeAny, "passthrough">>]>;
2072
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2073
+ type: z.ZodLiteral<"resource">;
2074
+ resource: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
2075
+ /**
2076
+ * The URI of this resource.
2077
+ */
2078
+ uri: z.ZodString;
2079
+ /**
2080
+ * The MIME type of this resource, if known.
2081
+ */
2082
+ mimeType: z.ZodOptional<z.ZodString>;
2083
+ }, {
2084
+ text: z.ZodString;
2085
+ }>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
2086
+ /**
2087
+ * The URI of this resource.
2088
+ */
2089
+ uri: z.ZodString;
2090
+ /**
2091
+ * The MIME type of this resource, if known.
2092
+ */
2093
+ mimeType: z.ZodOptional<z.ZodString>;
2094
+ }, {
2095
+ text: z.ZodString;
2096
+ }>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
2097
+ /**
2098
+ * The URI of this resource.
2099
+ */
2100
+ uri: z.ZodString;
2101
+ /**
2102
+ * The MIME type of this resource, if known.
2103
+ */
2104
+ mimeType: z.ZodOptional<z.ZodString>;
2105
+ }, {
2106
+ text: z.ZodString;
2107
+ }>, z.ZodTypeAny, "passthrough">>, z.ZodObject<z.objectUtil.extendShape<{
2108
+ /**
2109
+ * The URI of this resource.
2110
+ */
2111
+ uri: z.ZodString;
2112
+ /**
2113
+ * The MIME type of this resource, if known.
2114
+ */
2115
+ mimeType: z.ZodOptional<z.ZodString>;
2116
+ }, {
2117
+ blob: z.ZodString;
2118
+ }>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
2119
+ /**
2120
+ * The URI of this resource.
2121
+ */
2122
+ uri: z.ZodString;
2123
+ /**
2124
+ * The MIME type of this resource, if known.
2125
+ */
2126
+ mimeType: z.ZodOptional<z.ZodString>;
2127
+ }, {
2128
+ blob: z.ZodString;
2129
+ }>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
2130
+ /**
2131
+ * The URI of this resource.
2132
+ */
2133
+ uri: z.ZodString;
2134
+ /**
2135
+ * The MIME type of this resource, if known.
2136
+ */
2137
+ mimeType: z.ZodOptional<z.ZodString>;
2138
+ }, {
2139
+ blob: z.ZodString;
2140
+ }>, z.ZodTypeAny, "passthrough">>]>;
2141
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2142
+ type: z.ZodLiteral<"resource">;
2143
+ resource: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
2144
+ /**
2145
+ * The URI of this resource.
2146
+ */
2147
+ uri: z.ZodString;
2148
+ /**
2149
+ * The MIME type of this resource, if known.
2150
+ */
2151
+ mimeType: z.ZodOptional<z.ZodString>;
2152
+ }, {
2153
+ text: z.ZodString;
2154
+ }>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
2155
+ /**
2156
+ * The URI of this resource.
2157
+ */
2158
+ uri: z.ZodString;
2159
+ /**
2160
+ * The MIME type of this resource, if known.
2161
+ */
2162
+ mimeType: z.ZodOptional<z.ZodString>;
2163
+ }, {
2164
+ text: z.ZodString;
2165
+ }>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
2166
+ /**
2167
+ * The URI of this resource.
2168
+ */
2169
+ uri: z.ZodString;
2170
+ /**
2171
+ * The MIME type of this resource, if known.
2172
+ */
2173
+ mimeType: z.ZodOptional<z.ZodString>;
2174
+ }, {
2175
+ text: z.ZodString;
2176
+ }>, z.ZodTypeAny, "passthrough">>, z.ZodObject<z.objectUtil.extendShape<{
2177
+ /**
2178
+ * The URI of this resource.
2179
+ */
2180
+ uri: z.ZodString;
2181
+ /**
2182
+ * The MIME type of this resource, if known.
2183
+ */
2184
+ mimeType: z.ZodOptional<z.ZodString>;
2185
+ }, {
2186
+ blob: z.ZodString;
2187
+ }>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
2188
+ /**
2189
+ * The URI of this resource.
2190
+ */
2191
+ uri: z.ZodString;
2192
+ /**
2193
+ * The MIME type of this resource, if known.
2194
+ */
2195
+ mimeType: z.ZodOptional<z.ZodString>;
2196
+ }, {
2197
+ blob: z.ZodString;
2198
+ }>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
2199
+ /**
2200
+ * The URI of this resource.
2201
+ */
2202
+ uri: z.ZodString;
2203
+ /**
2204
+ * The MIME type of this resource, if known.
2205
+ */
2206
+ mimeType: z.ZodOptional<z.ZodString>;
2207
+ }, {
2208
+ blob: z.ZodString;
2209
+ }>, z.ZodTypeAny, "passthrough">>]>;
2210
+ }, z.ZodTypeAny, "passthrough">>]>, "many">;
2211
+ isError: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
2212
+ }>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
2213
+ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
2214
+ }, {
2215
+ content: z.ZodArray<z.ZodUnion<[z.ZodObject<{
2216
+ type: z.ZodLiteral<"text">;
2217
+ text: z.ZodString;
2218
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2219
+ type: z.ZodLiteral<"text">;
2220
+ text: z.ZodString;
2221
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2222
+ type: z.ZodLiteral<"text">;
2223
+ text: z.ZodString;
2224
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
2225
+ type: z.ZodLiteral<"image">;
2226
+ data: z.ZodString;
2227
+ mimeType: z.ZodString;
2228
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2229
+ type: z.ZodLiteral<"image">;
2230
+ data: z.ZodString;
2231
+ mimeType: z.ZodString;
2232
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2233
+ type: z.ZodLiteral<"image">;
2234
+ data: z.ZodString;
2235
+ mimeType: z.ZodString;
2236
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
2237
+ type: z.ZodLiteral<"resource">;
2238
+ resource: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
2239
+ /**
2240
+ * The URI of this resource.
2241
+ */
2242
+ uri: z.ZodString;
2243
+ /**
2244
+ * The MIME type of this resource, if known.
2245
+ */
2246
+ mimeType: z.ZodOptional<z.ZodString>;
2247
+ }, {
2248
+ text: z.ZodString;
2249
+ }>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
2250
+ /**
2251
+ * The URI of this resource.
2252
+ */
2253
+ uri: z.ZodString;
2254
+ /**
2255
+ * The MIME type of this resource, if known.
2256
+ */
2257
+ mimeType: z.ZodOptional<z.ZodString>;
2258
+ }, {
2259
+ text: z.ZodString;
2260
+ }>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
2261
+ /**
2262
+ * The URI of this resource.
2263
+ */
2264
+ uri: z.ZodString;
2265
+ /**
2266
+ * The MIME type of this resource, if known.
2267
+ */
2268
+ mimeType: z.ZodOptional<z.ZodString>;
2269
+ }, {
2270
+ text: z.ZodString;
2271
+ }>, z.ZodTypeAny, "passthrough">>, z.ZodObject<z.objectUtil.extendShape<{
2272
+ /**
2273
+ * The URI of this resource.
2274
+ */
2275
+ uri: z.ZodString;
2276
+ /**
2277
+ * The MIME type of this resource, if known.
2278
+ */
2279
+ mimeType: z.ZodOptional<z.ZodString>;
2280
+ }, {
2281
+ blob: z.ZodString;
2282
+ }>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
2283
+ /**
2284
+ * The URI of this resource.
2285
+ */
2286
+ uri: z.ZodString;
2287
+ /**
2288
+ * The MIME type of this resource, if known.
2289
+ */
2290
+ mimeType: z.ZodOptional<z.ZodString>;
2291
+ }, {
2292
+ blob: z.ZodString;
2293
+ }>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
2294
+ /**
2295
+ * The URI of this resource.
2296
+ */
2297
+ uri: z.ZodString;
2298
+ /**
2299
+ * The MIME type of this resource, if known.
2300
+ */
2301
+ mimeType: z.ZodOptional<z.ZodString>;
2302
+ }, {
2303
+ blob: z.ZodString;
2304
+ }>, z.ZodTypeAny, "passthrough">>]>;
2305
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2306
+ type: z.ZodLiteral<"resource">;
2307
+ resource: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
2308
+ /**
2309
+ * The URI of this resource.
2310
+ */
2311
+ uri: z.ZodString;
2312
+ /**
2313
+ * The MIME type of this resource, if known.
2314
+ */
2315
+ mimeType: z.ZodOptional<z.ZodString>;
2316
+ }, {
2317
+ text: z.ZodString;
2318
+ }>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
2319
+ /**
2320
+ * The URI of this resource.
2321
+ */
2322
+ uri: z.ZodString;
2323
+ /**
2324
+ * The MIME type of this resource, if known.
2325
+ */
2326
+ mimeType: z.ZodOptional<z.ZodString>;
2327
+ }, {
2328
+ text: z.ZodString;
2329
+ }>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
2330
+ /**
2331
+ * The URI of this resource.
2332
+ */
2333
+ uri: z.ZodString;
2334
+ /**
2335
+ * The MIME type of this resource, if known.
2336
+ */
2337
+ mimeType: z.ZodOptional<z.ZodString>;
2338
+ }, {
2339
+ text: z.ZodString;
2340
+ }>, z.ZodTypeAny, "passthrough">>, z.ZodObject<z.objectUtil.extendShape<{
2341
+ /**
2342
+ * The URI of this resource.
2343
+ */
2344
+ uri: z.ZodString;
2345
+ /**
2346
+ * The MIME type of this resource, if known.
2347
+ */
2348
+ mimeType: z.ZodOptional<z.ZodString>;
2349
+ }, {
2350
+ blob: z.ZodString;
2351
+ }>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
2352
+ /**
2353
+ * The URI of this resource.
2354
+ */
2355
+ uri: z.ZodString;
2356
+ /**
2357
+ * The MIME type of this resource, if known.
2358
+ */
2359
+ mimeType: z.ZodOptional<z.ZodString>;
2360
+ }, {
2361
+ blob: z.ZodString;
2362
+ }>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
2363
+ /**
2364
+ * The URI of this resource.
2365
+ */
2366
+ uri: z.ZodString;
2367
+ /**
2368
+ * The MIME type of this resource, if known.
2369
+ */
2370
+ mimeType: z.ZodOptional<z.ZodString>;
2371
+ }, {
2372
+ blob: z.ZodString;
2373
+ }>, z.ZodTypeAny, "passthrough">>]>;
2374
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2375
+ type: z.ZodLiteral<"resource">;
2376
+ resource: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
2377
+ /**
2378
+ * The URI of this resource.
2379
+ */
2380
+ uri: z.ZodString;
2381
+ /**
2382
+ * The MIME type of this resource, if known.
2383
+ */
2384
+ mimeType: z.ZodOptional<z.ZodString>;
2385
+ }, {
2386
+ text: z.ZodString;
2387
+ }>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
2388
+ /**
2389
+ * The URI of this resource.
2390
+ */
2391
+ uri: z.ZodString;
2392
+ /**
2393
+ * The MIME type of this resource, if known.
2394
+ */
2395
+ mimeType: z.ZodOptional<z.ZodString>;
2396
+ }, {
2397
+ text: z.ZodString;
2398
+ }>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
2399
+ /**
2400
+ * The URI of this resource.
2401
+ */
2402
+ uri: z.ZodString;
2403
+ /**
2404
+ * The MIME type of this resource, if known.
2405
+ */
2406
+ mimeType: z.ZodOptional<z.ZodString>;
2407
+ }, {
2408
+ text: z.ZodString;
2409
+ }>, z.ZodTypeAny, "passthrough">>, z.ZodObject<z.objectUtil.extendShape<{
2410
+ /**
2411
+ * The URI of this resource.
2412
+ */
2413
+ uri: z.ZodString;
2414
+ /**
2415
+ * The MIME type of this resource, if known.
2416
+ */
2417
+ mimeType: z.ZodOptional<z.ZodString>;
2418
+ }, {
2419
+ blob: z.ZodString;
2420
+ }>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
2421
+ /**
2422
+ * The URI of this resource.
2423
+ */
2424
+ uri: z.ZodString;
2425
+ /**
2426
+ * The MIME type of this resource, if known.
2427
+ */
2428
+ mimeType: z.ZodOptional<z.ZodString>;
2429
+ }, {
2430
+ blob: z.ZodString;
2431
+ }>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
2432
+ /**
2433
+ * The URI of this resource.
2434
+ */
2435
+ uri: z.ZodString;
2436
+ /**
2437
+ * The MIME type of this resource, if known.
2438
+ */
2439
+ mimeType: z.ZodOptional<z.ZodString>;
2440
+ }, {
2441
+ blob: z.ZodString;
2442
+ }>, z.ZodTypeAny, "passthrough">>]>;
2443
+ }, z.ZodTypeAny, "passthrough">>]>, "many">;
2444
+ isError: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
2445
+ }>, z.ZodTypeAny, "passthrough">>, z.ZodObject<z.objectUtil.extendShape<{
2446
+ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
2447
+ }, {
2448
+ toolResult: z.ZodUnknown;
2449
+ }>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
2450
+ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
2451
+ }, {
2452
+ toolResult: z.ZodUnknown;
2453
+ }>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
2454
+ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
2455
+ }, {
2456
+ toolResult: z.ZodUnknown;
2457
+ }>, z.ZodTypeAny, "passthrough">>]>;
2458
+ type CallToolResult = z.infer<typeof CallToolResultSchema>;
2459
+
2460
+ interface MCPClientConfig {
2461
+ /** Transport configuration for connecting to the MCP server */
2462
+ transport: TransportConfig;
2463
+ /** Optional callback for uncaught errors */
2464
+ onUncaughtError?: (error: unknown) => void;
2465
+ /** Optional client name, defaults to 'ai-sdk-mcp-client' */
2466
+ name?: string;
2467
+ }
2468
+ declare function createMCPClient(config: MCPClientConfig): Promise<MCPClient>;
2469
+ /**
2470
+ * A lightweight MCP Client implementation
2471
+ *
2472
+ * The primary purpose of this client is tool conversion between MCP<>AI SDK
2473
+ * but can later be extended to support other MCP features
2474
+ *
2475
+ * Tool parameters are automatically inferred from the server's JSON schema
2476
+ * if not explicitly provided in the tools configuration
2477
+ *
2478
+ * Not supported:
2479
+ * - Client options (e.g. sampling, roots) as they are not needed for tool conversion
2480
+ * - Accepting notifications
2481
+ */
2482
+ declare class MCPClient {
2483
+ private transport;
2484
+ private onUncaughtError?;
2485
+ private clientInfo;
2486
+ private requestMessageId;
2487
+ private responseHandlers;
2488
+ private serverCapabilities;
2489
+ private isClosed;
2490
+ constructor({ transport: transportConfig, name, onUncaughtError, }: MCPClientConfig);
2491
+ init(): Promise<this>;
2492
+ close(): Promise<void>;
2493
+ private request;
2494
+ private listTools;
2495
+ private callTool;
2496
+ private notification;
2497
+ /**
2498
+ * Returns a set of AI SDK tools from the MCP server
2499
+ * @returns A record of tool names to their implementations
2500
+ */
2501
+ tools<TOOL_SCHEMAS extends ToolSchemas = 'automatic'>({ schemas, }?: {
2502
+ schemas?: TOOL_SCHEMAS;
2503
+ }): Promise<McpToolSet<TOOL_SCHEMAS>>;
2504
+ private onClose;
2505
+ private onError;
2506
+ private onResponse;
2507
+ }
2508
+
1717
2509
  type ToolSet = Record<string, Tool>;
1718
2510
 
1719
2511
  type ToolCallUnion<TOOLS extends ToolSet> = ValueOf<{
@@ -2000,9 +2792,9 @@ declare namespace output {
2000
2792
  };
2001
2793
  }
2002
2794
 
2003
- declare const symbol$e: unique symbol;
2795
+ declare const symbol$f: unique symbol;
2004
2796
  declare class InvalidToolArgumentsError extends AISDKError {
2005
- private readonly [symbol$e];
2797
+ private readonly [symbol$f];
2006
2798
  readonly toolName: string;
2007
2799
  readonly toolArgs: string;
2008
2800
  constructor({ toolArgs, toolName, cause, message, }: {
@@ -2014,9 +2806,9 @@ declare class InvalidToolArgumentsError extends AISDKError {
2014
2806
  static isInstance(error: unknown): error is InvalidToolArgumentsError;
2015
2807
  }
2016
2808
 
2017
- declare const symbol$d: unique symbol;
2809
+ declare const symbol$e: unique symbol;
2018
2810
  declare class NoSuchToolError extends AISDKError {
2019
- private readonly [symbol$d];
2811
+ private readonly [symbol$e];
2020
2812
  readonly toolName: string;
2021
2813
  readonly availableTools: string[] | undefined;
2022
2814
  constructor({ toolName, availableTools, message, }: {
@@ -2731,6 +3523,7 @@ type LanguageModelV1Middleware = {
2731
3523
  * Wraps the generate operation of the language model.
2732
3524
  * @param options - Object containing the generate function, parameters, and model.
2733
3525
  * @param options.doGenerate - The original generate function.
3526
+ * @param options.doStream - The original stream function.
2734
3527
  * @param options.params - The parameters for the generate call. If the
2735
3528
  * `transformParams` middleware is used, this will be the transformed parameters.
2736
3529
  * @param options.model - The language model instance.
@@ -2738,12 +3531,15 @@ type LanguageModelV1Middleware = {
2738
3531
  */
2739
3532
  wrapGenerate?: (options: {
2740
3533
  doGenerate: () => ReturnType<LanguageModelV1['doGenerate']>;
3534
+ doStream: () => ReturnType<LanguageModelV1['doStream']>;
2741
3535
  params: LanguageModelV1CallOptions;
2742
3536
  model: LanguageModelV1;
2743
3537
  }) => Promise<Awaited<ReturnType<LanguageModelV1['doGenerate']>>>;
2744
3538
  /**
2745
3539
  * Wraps the stream operation of the language model.
3540
+ *
2746
3541
  * @param options - Object containing the stream function, parameters, and model.
3542
+ * @param options.doGenerate - The original generate function.
2747
3543
  * @param options.doStream - The original stream function.
2748
3544
  * @param options.params - The parameters for the stream call. If the
2749
3545
  * `transformParams` middleware is used, this will be the transformed parameters.
@@ -2751,6 +3547,7 @@ type LanguageModelV1Middleware = {
2751
3547
  * @returns A promise that resolves to the result of the stream operation.
2752
3548
  */
2753
3549
  wrapStream?: (options: {
3550
+ doGenerate: () => ReturnType<LanguageModelV1['doGenerate']>;
2754
3551
  doStream: () => ReturnType<LanguageModelV1['doStream']>;
2755
3552
  params: LanguageModelV1CallOptions;
2756
3553
  model: LanguageModelV1;
@@ -2775,6 +3572,11 @@ declare function extractReasoningMiddleware({ tagName, separator, startWithReaso
2775
3572
  startWithReasoning?: boolean;
2776
3573
  }): LanguageModelV1Middleware;
2777
3574
 
3575
+ /**
3576
+ * Simulates streaming chunks with the response from a generate call.
3577
+ */
3578
+ declare function simulateStreamingMiddleware(): LanguageModelV1Middleware;
3579
+
2778
3580
  /**
2779
3581
  * Wraps a LanguageModelV1 instance with middleware functionality.
2780
3582
  * This function allows you to apply middleware to transform parameters,
@@ -2831,9 +3633,9 @@ declare function customProvider<LANGUAGE_MODELS extends Record<string, LanguageM
2831
3633
  declare const experimental_customProvider: typeof customProvider;
2832
3634
  type ExtractModelId<MODELS extends Record<string, unknown>> = Extract<keyof MODELS, string>;
2833
3635
 
2834
- declare const symbol$c: unique symbol;
3636
+ declare const symbol$d: unique symbol;
2835
3637
  declare class NoSuchProviderError extends NoSuchModelError {
2836
- private readonly [symbol$c];
3638
+ private readonly [symbol$d];
2837
3639
  readonly providerId: string;
2838
3640
  readonly availableProviders: string[];
2839
3641
  constructor({ modelId, modelType, providerId, availableProviders, message, }: {
@@ -2887,9 +3689,9 @@ declare function simulateReadableStream<T>({ chunks, initialDelayInMs, chunkDela
2887
3689
  };
2888
3690
  }): ReadableStream<T>;
2889
3691
 
2890
- declare const symbol$b: unique symbol;
3692
+ declare const symbol$c: unique symbol;
2891
3693
  declare class InvalidArgumentError extends AISDKError {
2892
- private readonly [symbol$b];
3694
+ private readonly [symbol$c];
2893
3695
  readonly parameter: string;
2894
3696
  readonly value: unknown;
2895
3697
  constructor({ parameter, value, message, }: {
@@ -2944,9 +3746,9 @@ type SingleRequestTextStreamPart<TOOLS extends ToolSet> = {
2944
3746
  error: unknown;
2945
3747
  };
2946
3748
 
2947
- declare const symbol$a: unique symbol;
3749
+ declare const symbol$b: unique symbol;
2948
3750
  declare class InvalidStreamPartError extends AISDKError {
2949
- private readonly [symbol$a];
3751
+ private readonly [symbol$b];
2950
3752
  readonly chunk: SingleRequestTextStreamPart<any>;
2951
3753
  constructor({ chunk, message, }: {
2952
3754
  chunk: SingleRequestTextStreamPart<any>;
@@ -2955,7 +3757,7 @@ declare class InvalidStreamPartError extends AISDKError {
2955
3757
  static isInstance(error: unknown): error is InvalidStreamPartError;
2956
3758
  }
2957
3759
 
2958
- declare const symbol$9: unique symbol;
3760
+ declare const symbol$a: unique symbol;
2959
3761
  /**
2960
3762
  Thrown when no image could be generated. This can have multiple causes:
2961
3763
 
@@ -2963,7 +3765,7 @@ Thrown when no image could be generated. This can have multiple causes:
2963
3765
  - The model generated a response that could not be parsed.
2964
3766
  */
2965
3767
  declare class NoImageGeneratedError extends AISDKError {
2966
- private readonly [symbol$9];
3768
+ private readonly [symbol$a];
2967
3769
  /**
2968
3770
  The response metadata for each call.
2969
3771
  */
@@ -2976,7 +3778,7 @@ declare class NoImageGeneratedError extends AISDKError {
2976
3778
  static isInstance(error: unknown): error is NoImageGeneratedError;
2977
3779
  }
2978
3780
 
2979
- declare const symbol$8: unique symbol;
3781
+ declare const symbol$9: unique symbol;
2980
3782
  /**
2981
3783
  Thrown when no object could be generated. This can have several causes:
2982
3784
 
@@ -2989,7 +3791,7 @@ The error contains the following properties:
2989
3791
  - `text`: The text that was generated by the model. This can be the raw text or the tool call text, depending on the model.
2990
3792
  */
2991
3793
  declare class NoObjectGeneratedError extends AISDKError {
2992
- private readonly [symbol$8];
3794
+ private readonly [symbol$9];
2993
3795
  /**
2994
3796
  The text that was generated by the model. This can be the raw text or the tool call text, depending on the model.
2995
3797
  */
@@ -3012,21 +3814,21 @@ declare class NoObjectGeneratedError extends AISDKError {
3012
3814
  static isInstance(error: unknown): error is NoObjectGeneratedError;
3013
3815
  }
3014
3816
 
3015
- declare const symbol$7: unique symbol;
3817
+ declare const symbol$8: unique symbol;
3016
3818
  /**
3017
3819
  Thrown when no output type is specified and output-related methods are called.
3018
3820
  */
3019
3821
  declare class NoOutputSpecifiedError extends AISDKError {
3020
- private readonly [symbol$7];
3822
+ private readonly [symbol$8];
3021
3823
  constructor({ message }?: {
3022
3824
  message?: string;
3023
3825
  });
3024
3826
  static isInstance(error: unknown): error is NoOutputSpecifiedError;
3025
3827
  }
3026
3828
 
3027
- declare const symbol$6: unique symbol;
3829
+ declare const symbol$7: unique symbol;
3028
3830
  declare class ToolCallRepairError extends AISDKError {
3029
- private readonly [symbol$6];
3831
+ private readonly [symbol$7];
3030
3832
  readonly originalError: NoSuchToolError | InvalidToolArgumentsError;
3031
3833
  constructor({ cause, originalError, message, }: {
3032
3834
  message?: string;
@@ -3036,9 +3838,9 @@ declare class ToolCallRepairError extends AISDKError {
3036
3838
  static isInstance(error: unknown): error is ToolCallRepairError;
3037
3839
  }
3038
3840
 
3039
- declare const symbol$5: unique symbol;
3841
+ declare const symbol$6: unique symbol;
3040
3842
  declare class ToolExecutionError extends AISDKError {
3041
- private readonly [symbol$5];
3843
+ private readonly [symbol$6];
3042
3844
  readonly toolName: string;
3043
3845
  readonly toolArgs: JSONValue;
3044
3846
  readonly toolCallId: string;
@@ -3052,6 +3854,20 @@ declare class ToolExecutionError extends AISDKError {
3052
3854
  static isInstance(error: unknown): error is ToolExecutionError;
3053
3855
  }
3054
3856
 
3857
+ declare const symbol$5: unique symbol;
3858
+ /**
3859
+ * An error occurred with the MCP client.
3860
+ */
3861
+ declare class MCPClientError extends AISDKError {
3862
+ private readonly [symbol$5];
3863
+ constructor({ name, message, cause, }: {
3864
+ name?: string;
3865
+ message: string;
3866
+ cause?: unknown;
3867
+ });
3868
+ static isInstance(error: unknown): error is MCPClientError;
3869
+ }
3870
+
3055
3871
  declare const symbol$4: unique symbol;
3056
3872
  declare class InvalidDataContentError extends AISDKError {
3057
3873
  private readonly [symbol$4];
@@ -3250,4 +4066,4 @@ declare namespace llamaindexAdapter {
3250
4066
  };
3251
4067
  }
3252
4068
 
3253
- export { AssistantContent, AssistantResponse, CallWarning, CoreAssistantMessage, CoreMessage, CoreSystemMessage, CoreTool, CoreToolCallUnion, CoreToolChoice, CoreToolMessage, CoreToolResultUnion, CoreUserMessage, DataContent, DataStreamOptions, DataStreamWriter, DownloadError, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelUsage, GenerateImageResult as Experimental_GenerateImageResult, GeneratedImage as Experimental_GeneratedImage, Experimental_LanguageModelV1Middleware, FilePart, FinishReason, GenerateObjectResult, GenerateTextOnStepFinishCallback, GenerateTextResult, ImageModel, ImageGenerationWarning as ImageModelCallWarning, ImageModelResponseMetadata, ImagePart, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolArgumentsError, langchainAdapter as LangChainAdapter, LanguageModel, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, LanguageModelV1Middleware, llamaindexAdapter as LlamaIndexAdapter, LogProbs, MessageConversionError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputSpecifiedError, NoSuchProviderError, NoSuchToolError, ObjectStreamPart, output as Output, Provider, ProviderMetadata, RepairTextFunction, RetryError, StepResult, StreamData, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStepFinishCallback, StreamTextResult, StreamTextTransform, TelemetrySettings, TextPart, TextStreamPart, Tool, ToolCallPart, ToolCallRepairError, ToolCallRepairFunction, ToolCallUnion, ToolChoice, ToolContent, ToolExecutionError, ToolExecutionOptions, ToolResultPart, ToolResultUnion, ToolSet, UserContent, appendClientMessage, appendResponseMessages, convertToCoreMessages, coreAssistantMessageSchema, coreMessageSchema, coreSystemMessageSchema, coreToolMessageSchema, coreUserMessageSchema, cosineSimilarity, createDataStream, createDataStreamResponse, customProvider, embed, embedMany, experimental_createProviderRegistry, experimental_customProvider, generateImage as experimental_generateImage, experimental_wrapLanguageModel, extractReasoningMiddleware, generateObject, generateText, pipeDataStreamToResponse, simulateReadableStream, smoothStream, streamObject, streamText, tool, wrapLanguageModel };
4069
+ export { AssistantContent, AssistantResponse, CallWarning, CoreAssistantMessage, CoreMessage, CoreSystemMessage, CoreTool, CoreToolCallUnion, CoreToolChoice, CoreToolMessage, CoreToolResultUnion, CoreUserMessage, DataContent, DataStreamOptions, DataStreamWriter, DownloadError, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelUsage, GenerateImageResult as Experimental_GenerateImageResult, GeneratedImage as Experimental_GeneratedImage, Experimental_LanguageModelV1Middleware, FilePart, FinishReason, GenerateObjectResult, GenerateTextOnStepFinishCallback, GenerateTextResult, ImageModel, ImageGenerationWarning as ImageModelCallWarning, ImageModelResponseMetadata, ImagePart, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolArgumentsError, langchainAdapter as LangChainAdapter, LanguageModel, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, LanguageModelV1Middleware, llamaindexAdapter as LlamaIndexAdapter, LogProbs, MCPClientError, MessageConversionError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputSpecifiedError, NoSuchProviderError, NoSuchToolError, ObjectStreamPart, output as Output, Provider, ProviderMetadata, RepairTextFunction, RetryError, StepResult, StreamData, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStepFinishCallback, StreamTextResult, StreamTextTransform, TelemetrySettings, TextPart, TextStreamPart, Tool, ToolCallPart, ToolCallRepairError, ToolCallRepairFunction, ToolCallUnion, ToolChoice, ToolContent, ToolExecutionError, ToolExecutionOptions, ToolResultPart, ToolResultUnion, ToolSet, UserContent, appendClientMessage, appendResponseMessages, convertToCoreMessages, coreAssistantMessageSchema, coreMessageSchema, coreSystemMessageSchema, coreToolMessageSchema, coreUserMessageSchema, cosineSimilarity, createDataStream, createDataStreamResponse, customProvider, embed, embedMany, createMCPClient as experimental_createMCPClient, experimental_createProviderRegistry, experimental_customProvider, generateImage as experimental_generateImage, experimental_wrapLanguageModel, extractReasoningMiddleware, generateObject, generateText, pipeDataStreamToResponse, simulateReadableStream, simulateStreamingMiddleware, smoothStream, streamObject, streamText, tool, wrapLanguageModel };