Skip to main content
Glama

edubase_delete_exam

DestructiveIdempotent

Archive or delete an exam from the platform by providing its exam identification string.

Instructions

Remove/archive exam.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
examYesexam identification string

Implementation Reference

  • Tool definition (schema) for edubase_delete_exam - defines name, description, input (exam ID string), and empty output schema
    // DELETE /exam - Remove/archive exam
    {
    	name: 'edubase_delete_exam',
    	description: "Remove/archive exam.",
    	inputSchema: z.object({
    		exam: z.string().describe('exam identification string'),
    	}),
    	outputSchema: z.object({}).optional(),
    },
  • Generic handler for all edubase tools including edubase_delete_exam - splits tool name to extract HTTP method ('delete') and endpoint ('exam'), then calls sendEduBaseApiRequest with the method, constructed endpoint URL, and input args
    Object.values(EDUBASE_API_TOOLS_ANNOTATED).forEach((tool) => {
    	/* Register tools */
    	server.registerTool(tool.name, {
    		description: tool.description,
    		inputSchema: tool.inputSchema as any,
    		outputSchema: tool.outputSchema as any,
    		annotations: tool.annotations,
    	}, async (args: any, ctx: any): Promise<CallToolResult> => {
    		try {
    			const name = tool.name;
    			/* Decompose request and check arguments */
    			if (!name.match(/^edubase_(get|post|delete)/)) {
    				throw new Error('Invalid tool configuration');
    			}
    			if (!args) {
    				throw new Error('No arguments provided');
    			}
    
    			/* Prepare and send API request */
    			const [ , method, ...endpoint ] = name.split('_');
    			const response = await sendEduBaseApiRequest(method, (apiUrl || EDUBASE_API_URL) + '/' + endpoint.join(':'), args, authentication);
    
    			/* Return response */
    			if (z.object({}).strict().safeParse(tool.outputSchema).success) {
    				/* Endpoint with empty output schema */
    				return {
    					content: [{ type: 'text', text: '{}' }],
    					structuredContent: {},
    					isError: false,
    				};
    			} else if (response.length == 0) {
    				/* Endpoint without response */
    				return {
    					content: [{ type: 'text', text: 'Success.' }],
    					isError: false,
    				};
    			}
    			else if (typeof response != 'object') {
    				/* Response should be an object (hash or list) at this point */
    				throw new Error('Invalid response');
    			}
    			else
    			{
    				/* Return response (schema will be validated automatically) */
    				return {
    					content: [{ type: 'text', text: JSON.stringify(response) }],
    					structuredContent: response,
    					isError: false,
    				};
    			}
    		} catch (error) {
    			/* Request failed */
    			return {
    				content: [{
    					type: 'text',
    					text: `${error instanceof Error ? error.message : String(error)}`,
    				}],
    				isError: true,
    			};
    		}
    	});
  • src/index.ts:205-210 (registration)
    Registration of edubase_delete_exam (and all other tools) via server.registerTool using the tool's definition from the exported array
    server.registerTool(tool.name, {
    	description: tool.description,
    	inputSchema: tool.inputSchema as any,
    	outputSchema: tool.outputSchema as any,
    	annotations: tool.annotations,
    }, async (args: any, ctx: any): Promise<CallToolResult> => {
  • src/tools.ts:95-109 (registration)
    Aggregation of all tool definitions including EDUBASE_API_TOOLS_EXAMS where edubase_delete_exam is defined
    export const EDUBASE_API_TOOLS = [
    	...EDUBASE_API_TOOLS_COMMON,
    	...EDUBASE_API_TOOLS_QUESTIONS,
    	...EDUBASE_API_TOOLS_EXAMS,
    	...EDUBASE_API_TOOLS_PLAYS,
    	...EDUBASE_API_TOOLS_QUIZES,
    	...EDUBASE_API_TOOLS_USERS,
    	...EDUBASE_API_TOOLS_CLASSES,
    	...EDUBASE_API_TOOLS_ORGANIZATIONS,
    	...EDUBASE_API_TOOLS_INTEGRATIONS,
    	...EDUBASE_API_TOOLS_TAGS,
    	...EDUBASE_API_TOOLS_PERMISSIONS,
    	...EDUBASE_API_TOOLS_METRICS
    ] as EduBaseApiTool[];
    export const EDUBASE_API_TOOLS_ANNOTATED = withToolAnnotations(EDUBASE_API_TOOLS);
  • Helper function that sends the actual HTTP DELETE request to the EduBase API endpoint for edubase_delete_exam
    async function sendEduBaseApiRequest(method: string, endpoint: string, data: object, authentication: EduBaseAuthentication | null) {
    	/* Check method and endpoint */
    	method = method.toUpperCase()
    	if (!['GET', 'POST', 'DELETE'].includes(method)) {
    		throw new Error('Invalid method: "' + method + '"');
    	}
    	if (endpoint.length == 0) {
    		throw new Error('Invalid endpoint');
    	}
    
    	/* Check rate limit */
    	checkRateLimit();
    
    	/* Prepare authentication (prefer EDUBASE_API_APP and EDUBASE_API_KEY environment variables) */
    	if (!authentication) {
    		authentication = { app: EDUBASE_API_APP, secret: EDUBASE_API_KEY };
    	} else {
    		if (!authentication.hasOwnProperty('app') || authentication.app.length == 0 || EDUBASE_API_APP.length > 0) {
    			authentication.app = EDUBASE_API_APP;
    		}
    		if (!authentication.hasOwnProperty('secret') || authentication.secret.length == 0 || EDUBASE_API_KEY.length > 0) {
    			authentication.secret = EDUBASE_API_KEY;
    		}
    	}
    
    	/* Send request with input data */
    	let headers = {
    		'Content-Type': 'application/json',
    		'Accept-Encoding': 'gzip',
    		'EduBase-API-Client': 'MCP',
    		'EduBase-API-Transport': (STREAMABLE_HTTP) ? 'Streamable HTTP' : ((SSE) ? 'SSE' : 'Stdio'),
    		'EduBase-API-App': authentication.app,
    		'EduBase-API-Secret': authentication.secret
    	};
    	const response = await fetch(endpoint + (method == 'GET' ? '?' + queryString.stringify(data) : ''), {
    		method: method,
    		body: (method != 'GET' ? JSON.stringify(data) : undefined),
    		headers: headers
    	});
    	if (!response.ok) {
    		throw new Error(`EduBase API error: ${response.status} ${response.statusText}` + (response.headers.has('EduBase-API-Error') ? ` (${response.headers.get('EduBase-API-Error')})` : ''));
    	}
    
    	/* Parse response and return as object */
    	let clonedResponse = response.clone();
    	try {
    		/* First try to decode as JSON */
    		return await response.json();
    	} catch (error) {
    		/* Response might be empty string with a 200 status code */
    		return await clonedResponse.text();
    	}
    }
Behavior3/5

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

Annotations already disclose destructiveHint=true and idempotentHint=true. The description adds the term 'archive', hinting at reversibility, but does not explain side effects or cascading behavior. With annotations covering the core safety profile, the description adds modest context.

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 a single short sentence with no waste. It succinctly states the action and resource, earning its place without redundancy.

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

Completeness3/5

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

Given the tool's simplicity (one parameter, no output schema, no nested objects), the description is adequate but minimal. It does not mention prerequisites, return behavior, or success criteria. For a straightforward delete/archive tool, it meets basic needs but lacks completeness for thorough understanding.

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?

Schema coverage is 100% and the parameter 'exam' is described as 'exam identification string'. The description adds no extra meaning about the parameter's format or source. Baseline 3 applies as schema already provides meaning.

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

Purpose4/5

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

The description 'Remove/archive exam' clearly identifies the action (remove/archive) and the resource (exam). It distinguishes from sibling tools that delete other entities like permissions or tags. However, the dual term 'remove/archive' introduces slight ambiguity about whether it's a soft or hard delete.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. Among many sibling delete tools (e.g., edubase_delete_exam_permission, edubase_delete_exam_tag), there is no indication of the appropriate context or exclusions.

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/EduBase/MCP'

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