refactor: remove unused response variables in database, git, node, project, schedule, spider, task modules

This commit is contained in:
Marvin Zhang
2025-06-20 14:55:54 +08:00
parent 4f33460d45
commit b7b7f25451
8 changed files with 24 additions and 24 deletions

View File

@@ -1,16 +1,16 @@
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { CrawlabClient } from "./client.js";
import { configureSpiderTools } from "./tools/spiders.js";
import { configureTaskTools } from "./tools/tasks.js";
import { configureNodeTools } from "./tools/nodes.js";
import { configureScheduleTools } from "./tools/schedules.js";
import { configureSystemTools } from "./tools/system.js";
import { configureProjectTools } from "./tools/projects.js";
import { configureDatabaseTools } from "./tools/databases.js";
import { configureGitTools } from "./tools/git.js";
import { configureStatsTools } from "./tools/stats.js";
import { configureAITools } from "./tools/ai.js";
import { configureSpiderTools } from '@tools/spiders';
import { configureTaskTools } from '@tools/tasks';
import { configureNodeTools } from '@tools/nodes';
import { configureScheduleTools } from '@tools/schedules';
import { configureSystemTools } from '@tools/system';
import { configureProjectTools } from '@tools/projects';
import { configureDatabaseTools } from '@tools/databases';
import { configureGitTools } from '@tools/git';
import { configureStatsTools } from '@tools/stats';
import { configureAITools } from '@tools/ai';
export function configureAllTools(server: McpServer, client: CrawlabClient) {
configureSpiderTools(server, client);

View File

@@ -184,7 +184,7 @@ export function configureDatabaseTools(server: McpServer, client: CrawlabClient)
},
async ({ database_id }) => {
try {
const response = await client.deleteDatabase(database_id);
await client.deleteDatabase(database_id);
return {
content: [
{

View File

@@ -169,7 +169,7 @@ export function configureGitTools(server: McpServer, client: CrawlabClient) {
},
async ({ git_id }) => {
try {
const response = await client.deleteGitRepo(git_id);
await client.deleteGitRepo(git_id);
return {
content: [
{
@@ -200,7 +200,7 @@ export function configureGitTools(server: McpServer, client: CrawlabClient) {
},
async ({ git_id }) => {
try {
const response = await client.cloneGitRepo(git_id);
await client.cloneGitRepo(git_id);
return {
content: [
{
@@ -231,7 +231,7 @@ export function configureGitTools(server: McpServer, client: CrawlabClient) {
},
async ({ git_id }) => {
try {
const response = await client.pullGitRepo(git_id);
await client.pullGitRepo(git_id);
return {
content: [
{

View File

@@ -123,7 +123,7 @@ export function configureNodeTools(server: McpServer, client: CrawlabClient) {
},
async ({ node_id }) => {
try {
const response = await client.enableNode(node_id);
await client.enableNode(node_id);
return {
content: [
{
@@ -154,7 +154,7 @@ export function configureNodeTools(server: McpServer, client: CrawlabClient) {
},
async ({ node_id }) => {
try {
const response = await client.disableNode(node_id);
await client.disableNode(node_id);
return {
content: [
{

View File

@@ -155,7 +155,7 @@ export function configureProjectTools(server: McpServer, client: CrawlabClient)
},
async ({ project_id }) => {
try {
const response = await client.deleteProject(project_id);
await client.deleteProject(project_id);
return {
content: [
{

View File

@@ -189,7 +189,7 @@ export function configureScheduleTools(server: McpServer, client: CrawlabClient)
},
async ({ schedule_id }) => {
try {
const response = await client.deleteSchedule(schedule_id);
await client.deleteSchedule(schedule_id);
return {
content: [
{
@@ -220,7 +220,7 @@ export function configureScheduleTools(server: McpServer, client: CrawlabClient)
},
async ({ schedule_id }) => {
try {
const response = await client.enableSchedule(schedule_id);
await client.enableSchedule(schedule_id);
return {
content: [
{
@@ -251,7 +251,7 @@ export function configureScheduleTools(server: McpServer, client: CrawlabClient)
},
async ({ schedule_id }) => {
try {
const response = await client.disableSchedule(schedule_id);
await client.disableSchedule(schedule_id);
return {
content: [
{

View File

@@ -207,7 +207,7 @@ export function configureSpiderTools(server: McpServer, client: CrawlabClient) {
},
async ({ spider_id }) => {
try {
const response = await client.deleteSpider(spider_id);
await client.deleteSpider(spider_id);
return {
content: [
{
@@ -347,7 +347,7 @@ export function configureSpiderTools(server: McpServer, client: CrawlabClient) {
},
async ({ spider_id, file_path, content }) => {
try {
const response = await client.saveSpiderFile(spider_id, file_path, content);
await client.saveSpiderFile(spider_id, file_path, content);
return {
content: [
{

View File

@@ -86,7 +86,7 @@ export function configureTaskTools(server: McpServer, client: CrawlabClient) {
},
async ({ task_id }) => {
try {
const response = await client.cancelTask(task_id);
await client.cancelTask(task_id);
return {
content: [
{
@@ -148,7 +148,7 @@ export function configureTaskTools(server: McpServer, client: CrawlabClient) {
},
async ({ task_id }) => {
try {
const response = await client.deleteTask(task_id);
await client.deleteTask(task_id);
return {
content: [
{