Skip to main content
Glama

edubase_delete_filebin_upload

DestructiveIdempotent

Delete an uploaded file or temporary file upload link from EduBase by providing its unique filebin identifier.

Instructions

Delete an uploaded file and/or temporary file upload link.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesexternal unique filebin identifier of the uploaded file or temporary file upload link

Implementation Reference

  • Schema definition for edubase_delete_filebin_upload tool: accepts an 'id' string parameter and returns an empty output schema.
    // DELETE /filebin:upload - Delete an uploaded file and/or temporary file upload link
    {
    	name: 'edubase_delete_filebin_upload',
    	description: 'Delete an uploaded file and/or temporary file upload link.',
    	inputSchema: z.object({
    		id: z.string().describe('external unique filebin identifier of the uploaded file or temporary file upload link'),
    	}),
    	outputSchema: z.object({}).optional(),
    },
  • src/index.ts:203-264 (registration)
    Generic registration handler that dynamically registers all EDUBASE_API_TOOLS (including edubase_delete_filebin_upload) by parsing the tool name to extract HTTP method and endpoint, then calling sendEduBaseApiRequest.
    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,
    			};
    		}
    	});
    });
  • Handler function that executes the API request. For edubase_delete_filebin_upload, the tool name is parsed as method='delete' and endpoint='filebin:upload', then a DELETE request is sent to the EduBase API with the input arguments as JSON body.
    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();
    	}
    }
  • Helper that infers annotations for the tool - for edubase_delete_filebin_upload (method='delete'), it sets destructiveHint=true and idempotentHint=true.
    function inferToolAnnotations(tool: EduBaseApiTool): EduBaseToolAnnotations {
       const method = getToolMethod(tool.name);
       const readOnly = method === 'get';
       const destructive = method === 'delete';
       const idempotent = method === 'get' || method === 'delete';
    
       return {
          title: getToolTitle(tool),
          readOnlyHint: readOnly,
          destructiveHint: readOnly ? false : destructive,
          idempotentHint: idempotent,
          openWorldHint: false,
       };
    }
    function withToolAnnotations(tools: EduBaseApiTool[]): EduBaseApiTool[] {
       return tools.map((tool) => ({
          ...tool,
          annotations: {
             ...inferToolAnnotations(tool),
             ...(tool.annotations || {}),
          },
       }));
    }
    
    /* Tool definitions */
    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);
Behavior4/5

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

The description adds behavioral context by stating the tool can delete either a file or a link (via 'and/or'), which goes beyond the annotations' destructive and idempotent hints. However, it does not clarify what happens if the file is in use or the link is expired, leaving minor ambiguity.

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, well-structured sentence that front-loads the purpose. Every word is necessary, and there is no redundant information.

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?

For a simple delete tool with one parameter and no output schema, the description is largely complete. It lacks information about the response format or error handling, but the core functionality is clear.

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 input schema already provides full coverage for the 'id' parameter with a clear description. The tool description does not add additional meaning or context about the parameter beyond what the schema states, resulting in baseline value.

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 action ('Delete') and resource ('uploaded file and/or temporary file upload link'), distinguishing it from other delete tools that target different entities like class members or permissions.

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

Usage Guidelines3/5

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

The description implies usage as the delete operation for filebin uploads, but provides no explicit guidance on when to use this tool versus alternatives like edubase_post_filebin_upload or edubase_filebin, nor any prerequisites or post-conditions.

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