You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// GET https://api.webflow.com/v2/sites/:site_id/registered_scripts
14
-
server.tool(
15
-
"site_registered_scripts_list",
16
-
"List all registered scripts for a site. To apply a script to a site or page, first register it via the Register Script endpoints, then apply it using the relevant Site or Page endpoints.",
17
-
{
18
-
site_id: z.string().describe("Unique identifier for the site."),
// GET https://api.webflow.com/v2/sites/:site_id/custom_code
34
-
server.tool(
35
-
"site_applied_scripts_list",
36
-
"Get all scripts applied to a site by the App. To apply a script to a site or page, first register it via the Register Script endpoints, then apply it using the relevant Site or Page endpoints.",
37
-
{
38
-
site_id: z.string().describe("Unique identifier for the site."),
// If it's a 404, we'll try to clear the scripts another way
100
+
if(isApiError(error)&&error.status===404){
101
+
returnerror.message??"No custom code found";
102
+
}
103
+
throwerror;
108
104
}
109
-
);
105
+
};
110
106
111
107
server.tool(
112
-
"delete_all_site_scripts",
108
+
"data_scripts_tool",
109
+
"Data tool - Scripts tool to perform actions like list registered scripts, list applied scripts, add inline site script, and delete all site scripts",
113
110
{
114
-
site_id: z.string(),
111
+
actions: z.array(
112
+
z.object({
113
+
// GET https://api.webflow.com/v2/sites/:site_id/registered_scripts
114
+
list_registered_scripts: z
115
+
.object({
116
+
site_id: z.string().describe("Unique identifier for the site."),
117
+
})
118
+
.optional()
119
+
.describe(
120
+
"List all registered scripts for a site. To apply a script to a site or page, first register it via the Register Script endpoints, then apply it using the relevant Site or Page endpoints."
121
+
),
122
+
// GET https://api.webflow.com/v2/sites/:site_id/custom_code
123
+
list_applied_scripts: z
124
+
.object({
125
+
site_id: z.string().describe("Unique identifier for the site."),
126
+
})
127
+
.optional()
128
+
.describe(
129
+
"Get all scripts applied to a site by the App. To apply a script to a site or page, first register it via the Register Script endpoints, then apply it using the relevant Site or Page endpoints."
130
+
),
131
+
// POST https://api.webflow.com/v2/sites/:site_id/registered_scripts/inline
132
+
add_inline_site_script: z
133
+
.object({
134
+
site_id: z.string().describe("Unique identifier for the site."),
135
+
request: RegisterInlineSiteScriptSchema,
136
+
})
137
+
.optional()
138
+
.describe(
139
+
"Register an inline script for a site. Inline scripts are limited to 2000 characters."
0 commit comments