Skip to main content
Glama

新增任务

add_job

Create a new XXL-JOB task with required executor group, schedule config, and JobHandler. Defaults handle routing, blocking, and expiration strategies, and the job is initially stopped.

Instructions

在 XXL-JOB 中新增一个任务。必填:执行器组 id、任务描述、调度类型与配置、JobHandler。未提供的可选项使用默认值:路由策略 FIRST、阻塞策略 SERIAL_EXECUTION、过期策略 DO_NOTHING、运行模式 BEAN。新增后默认为停止状态,可用 start_job 启动。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
authorNo负责人
jobDescYes任务描述
jobGroupYes执行器组 id(可用 list_job_groups 查询)
alarmEmailNo报警邮件(多个逗号分隔)
childJobIdNo子任务 id(多个逗号分隔)
scheduleConfNo调度配置:CRON 时为 Cron 表达式(6~7 段),FIX_RATE 时为秒数
scheduleTypeYes调度类型:CRON=Cron 表达式,FIX_RATE=固定速度(秒),NONE=不调度
executorParamNo任务运行参数(可选)
executorHandlerYes执行器中的 JobHandler 名称(@XxlJob 注解值)
executorTimeoutNo任务超时时间(秒),0=不限制
misfireStrategyNo调度过期策略,默认 DO_NOTHING
executorBlockStrategyNo阻塞处理策略,默认 SERIAL_EXECUTION
executorRouteStrategyNo路由策略,默认 FIRST
executorFailRetryCountNo失败重试次数,0=不重试
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the burden. It discloses key behaviors: default values for routing, blocking, and misfire strategies, the BEAN run mode default, and that the job is created in a stopped state. This provides essential state-related transparency, though it does not cover error handling or side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, consisting of two sentences that front-load the core action and then efficiently list required fields and defaults. Every sentence adds value without unnecessary fluff, making it well-structured for quick comprehension.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (14 parameters, no output schema), the description covers required fields, defaults, and the initial stopped state, providing sufficient context for usage. It omits return value details, but this is not critical given the presence of related query tools like get_job and list_jobs.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 100% description coverage for all 14 properties, so the description adds minimal parameter-level meaning. It restates default values that are already in the schema and adds the run mode BEAN default, but this is more behavioral than parameter semantics. The baseline for high schema coverage is 3, and the description does not significantly elevate it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool adds a new job in XXL-JOB with a specific verb ('新增') and resource. It lists required fields and differentiates from siblings by noting the default stopped state and referencing start_job for starting, making the purpose unmistakable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description specifies required inputs and default values for optional parameters, and mentions using start_job to start the created job. It does not explicitly contrast with update_job or other alternative tools, but the workflow context is clear enough for an agent to select this tool appropriately.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/shaguocgl/mcp-xxl-job'

If you have feedback or need assistance with the MCP directory API, please join our Discord server